Skip to content

Commit

Permalink
Simplify the topic mangling so other environments work
Browse files Browse the repository at this point in the history
I stole this from other consumers when I first implemented this, but it
actually makes no sense. Drop the if statement and always use whatever
prefix and environment fedmsg is using.

Signed-off-by: Jeremy Cline <jeremy@jcline.org>
  • Loading branch information
jeremycline committed Apr 8, 2018
1 parent 2f19ab4 commit 6ffab06
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions anitya/librariesio_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,19 @@ class LibrariesioConsumer(FedmsgConsumer):
configuration to enable this consumer.
"""
topic = [
'org.fedoraproject.prod.sse2fedmsg.librariesio',
'sse2fedmsg.librariesio',
]

config_key = 'anitya.libraryio.enabled'

def __init__(self, hub):
# If we're in development mode, add the dev versions of the topics so
# local playback with fedmsg-dg-replay works as expected.
if hub.config['environment'] == 'dev':
prefix, env = hub.config['topic_prefix'], hub.config['environment']
self.topic = self.topic + [
'.'.join([prefix, env] + topic.split('.')[3:])
for topic in self.topic
]
prefix, env = hub.config['topic_prefix'], hub.config['environment']
self.topic = self.topic + [
'.'.join([prefix, env] + topic)
for topic in self.topic
]
_log.info('Subscribing to the following fedmsg topics: %r', self.topic)

initialize(config.config)
Expand Down

0 comments on commit 6ffab06

Please sign in to comment.