Skip to content

Commit b24d5f4

Browse files
authored
Merge pull request #152 from ceph/remove-amqp
remove everything to do with amqp messages
2 parents 29521ca + bb4ac16 commit b24d5f4

File tree

11 files changed

+2
-123
lines changed

11 files changed

+2
-123
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ dependencies = [
1616
"pecan-notario",
1717
"requests",
1818
"jinja2",
19-
"pika",
2019
]
2120
classifiers = [
2221
'Development Status :: 4 - Beta',

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ alembic==1.13.2
99
ipython==5.0.0
1010
requests==2.25.1
1111
jinja2==3.1.4
12-
pika==1.2.0
1312
enum34==1.1.10

shaman/controllers/api/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
import shaman.controllers.api.repos # noqa
22
import shaman.controllers.api.nodes # noqa
33
import shaman.controllers.api.builds # noqa
4-
import shaman.controllers.api.bus # noqa

shaman/controllers/api/bus/__init__.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

shaman/controllers/root.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def index(self):
2424
nodes = api.nodes.NodesController()
2525
search = _search.SearchController()
2626
builds = api.builds.ProjectsAPIController()
27-
bus = api.bus.BusController()
2827

2928

3029
class RootController(object):

shaman/models/__init__.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import datetime
2-
import json
32
from sqlalchemy import create_engine, MetaData, event
43
from sqlalchemy.orm import scoped_session, sessionmaker, object_session, mapper
54
from sqlalchemy.ext.declarative import declarative_base
@@ -70,23 +69,6 @@ def _date_json_converter(item):
7069
if isinstance(item, datetime.datetime):
7170
return str(item)
7271

73-
74-
def publish_update_message(mapper, connection, target):
75-
"""
76-
Send a message to RabbitMQ everytime a Repo
77-
is updated
78-
"""
79-
from shaman.util import publish_message
80-
81-
if isinstance(target, Build):
82-
topic = "builds"
83-
elif isinstance(target, Repo):
84-
topic = "repos"
85-
routing_key = "{}.{}".format(target.project.name, topic)
86-
body = json.dumps(target.__json__(), default=_date_json_converter)
87-
publish_message(routing_key, body)
88-
89-
9072
# Utilities:
9173

9274
def get_or_create(model, **kwargs):

shaman/models/builds.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from sqlalchemy.orm import relationship, backref, deferred
55
from sqlalchemy.event import listen
66
from sqlalchemy.orm.exc import DetachedInstanceError
7-
from shaman.models import Base, update_timestamp, publish_update_message
7+
from shaman.models import Base, update_timestamp
88
from shaman.models.types import JSONType
99

1010

@@ -125,4 +125,3 @@ def get_url(self, up_to_part=None):
125125
# listen for timestamp modifications
126126
listen(Build, 'before_insert', update_timestamp)
127127
listen(Build, 'before_update', update_timestamp)
128-
listen(Build, 'after_update', publish_update_message)

shaman/models/repos.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from sqlalchemy.orm import relationship, backref, deferred
44
from sqlalchemy.event import listen
55
from sqlalchemy.orm.exc import DetachedInstanceError
6-
from shaman.models import Base, update_timestamp, publish_update_message
6+
from shaman.models import Base, update_timestamp
77
from shaman.models.types import JSONType
88

99

@@ -101,4 +101,3 @@ def get_url(self):
101101
# listen for timestamp modifications
102102
listen(Repo, 'before_insert', update_timestamp)
103103
listen(Repo, 'before_update', update_timestamp)
104-
listen(Repo, 'after_update', publish_update_message)

shaman/tests/conftest.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,6 @@ def factory():
4343
return Factory
4444

4545

46-
@pytest.fixture(autouse=True)
47-
def no_pika_requests(monkeypatch, factory):
48-
"""
49-
If you don't do anything to patch pika, this fxiture will automatically
50-
patchn it and prevent outbound requests.
51-
"""
52-
fake_connection = factory(
53-
queue_bind=lambda: True,
54-
close=lambda: True,
55-
channel=lambda: factory(
56-
exchange_declare=lambda *a, **kw: True,
57-
queue_bind=lambda *a: True,
58-
basic_publish=lambda *a, **kw: True,
59-
queue_declare=lambda *a, **kw: True,),
60-
)
61-
monkeypatch.setattr("pika.BlockingConnection", lambda *a: fake_connection)
62-
63-
6446
def config_file():
6547
here = os.path.abspath(os.path.dirname(__file__))
6648
return os.path.join(here, 'config.py')

shaman/tests/controllers/test_bus.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)