Skip to content

Commit cbc171f

Browse files
committed
Drop fedora-messaging
The service was never deployed for Fedora, let's not pull in the extra dependency for that.
1 parent e964e3f commit cbc171f

File tree

7 files changed

+4
-62
lines changed

7 files changed

+4
-62
lines changed

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ RUN dnf -y --setopt=install_weak_deps=False update \
2222
mod_ldap \
2323
mod_ssl \
2424
python3-defusedxml \
25-
python3-fedora \
2625
python3-flask \
2726
python3-flask-login \
2827
python3-flask-migrate \

conf/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class BaseConfiguration(object):
5555

5656
# Select backend where message will be sent to. Currently, umb is supported
5757
# which means the Unified Message Bus.
58-
MESSAGING_BACKEND = "" # fedora-messaging or umb
58+
MESSAGING_BACKEND = "" # rhmsg
5959

6060
# List of broker URLs. Each of them is a string consisting of domain and
6161
# optiona port.

cts/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class Config(object):
144144
"messaging_backend": {
145145
"type": str,
146146
"default": "",
147-
"desc": "Messaging backend, rhmsg or fedora-messaging.",
147+
"desc": "Messaging backend, rhmsg.",
148148
},
149149
"messaging_broker_urls": {
150150
"type": list,
@@ -169,7 +169,7 @@ class Config(object):
169169
"messaging_topic_prefix": {
170170
"type": str,
171171
"default": "cts.",
172-
"desc": "Prefix for AMQP or fedora-messaging messages.",
172+
"desc": "Prefix for AMQP messages.",
173173
},
174174
"oidc_base_namespace": {
175175
"type": str,

cts/messaging.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,23 +119,9 @@ def _send():
119119
_retry_with_backoff(_send)
120120

121121

122-
def _fedora_messaging_send_msg(msgs):
123-
"""Send message to fedora-messaging."""
124-
from fedora_messaging import api, config
125-
126-
config.conf.setup_logging()
127-
128-
for msg in msgs:
129-
event = msg.get("event", "event")
130-
topic = "%s%s" % (conf.messaging_topic_prefix, event)
131-
api.publish(api.Message(topic=topic, body=msg))
132-
133-
134122
def _get_messaging_backend():
135123
if conf.messaging_backend == "rhmsg":
136124
return _umb_send_msg
137-
elif conf.messaging_backend == "fedora-messaging":
138-
return _fedora_messaging_send_msg
139125
elif conf.messaging_backend:
140126
raise ValueError("Unknown messaging backend {0}".format(conf.messaging_backend))
141127
else:

docs/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ For production env running via httpd for example, `openapispec.json` should be s
2121
Messaging API
2222
=============
2323

24-
CTS also sends AMQP or fedora-messaging messages when Compose changes.
24+
CTS also sends AMQP messages when Compose changes.
2525

2626
Topic: cts.compose-created
2727
--------------------------

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
python-fedora
21
sqlalchemy<2.0 # For Flask 2.2.3
32
Flask==2.2.3 # Pin version for Flask-Login
43
Flask-Migrate

tests/test_events.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@
3636
except ImportError:
3737
rhmsg = None
3838

39-
try:
40-
import fedora_messaging
41-
except ImportError:
42-
fedora_messaging = None
43-
4439

4540
@unittest.skipUnless(rhmsg, "rhmsg is required to run this test case.")
4641
class TestRHMsgSendMessageWhenComposeIsCreated(ModelsBaseTest):
@@ -86,43 +81,6 @@ def test_send_message(self, Message, AMQProducer):
8681
producer_send.assert_called_once_with(Message.return_value)
8782

8883

89-
@unittest.skipUnless(
90-
fedora_messaging, "fedora_messaging is required to run this test case."
91-
)
92-
class TestFedoraMessagingSendMessageWhenComposeIsCreated(ModelsBaseTest):
93-
"""Test send message when compose is created"""
94-
95-
disable_event_handlers = False
96-
97-
def setUp(self):
98-
super(TestFedoraMessagingSendMessageWhenComposeIsCreated, self).setUp()
99-
100-
# Real lock is not required for running tests
101-
self.mock_lock = patch("threading.Lock")
102-
self.mock_lock.start()
103-
104-
def tearDown(self):
105-
super(TestFedoraMessagingSendMessageWhenComposeIsCreated, self).tearDown()
106-
self.mock_lock.stop()
107-
108-
def setup_composes(self):
109-
User.create_user(username="odcs")
110-
self.compose = Compose.create(db.session, "odcs", self.ci)[0]
111-
112-
@patch.object(conf, "messaging_backend", new="fedora-messaging")
113-
@patch("fedora_messaging.api.Message")
114-
@patch("fedora_messaging.api.publish")
115-
def test_send_message(self, publish, Message):
116-
compose = Compose.create(db.session, "odcs", self.ci)[0]
117-
118-
Message.assert_called_once_with(
119-
topic="cts.compose-created",
120-
body={"event": "compose-created", "compose": compose.json()},
121-
)
122-
123-
publish.assert_called_once_with(Message.return_value)
124-
125-
12684
@patch("cts.messaging.publish")
12785
class TestMessaging(ModelsBaseTest):
12886
"""Test send message when compose is created"""

0 commit comments

Comments
 (0)