#132 Allow subscribing to configurable bus topic.
Merged 6 years ago by ralph. Opened 6 years ago by ralph.

file modified
+3 -1
@@ -1,3 +1,5 @@ 

  config = dict(

-     resultsdb_handler=True

+     resultsdb_handler=True,

+     # Topic on which greenwave should listen for new resultsdb results.

+     resultsdb_topic_suffix='taskotron.result.new',

  )

file modified
+3 -1
@@ -1,3 +1,5 @@ 

  config = dict(

-     waiverdb_handler=True

+     waiverdb_handler=True,

+     # Topic on which greenwave should listen for new waiverdb waivers.

+     waiverdb_topic_suffix='waiver.new',

  )

@@ -48,9 +48,8 @@ 

  

          prefix = hub.config.get('topic_prefix')

          env = hub.config.get('environment')

-         self.topic = [

-             prefix + '.' + env + '.taskotron.result.new',

-         ]

+         suffix = hub.config.get('resultsdb_topic_suffix', 'taskotron.result.new')

Oh yeah... hopefully gonna be 'resultsdb.result.new' soon in Fedora too :-)

+         self.topic = '.'.join([prefix, env, suffix])

          self.fedmsg_config = fedmsg.config.load_config()

  

          super(ResultsDBHandler, self).__init__(hub, *args, **kwargs)

@@ -43,9 +43,8 @@ 

  

          prefix = hub.config.get('topic_prefix')

          env = hub.config.get('environment')

-         self.topic = [

-             prefix + '.' + env + '.waiver.new',

-         ]

+         suffix = hub.config.get('waiverdb_topic_suffix', 'waiver.new')

+         self.topic = '.'.join([prefix, env, suffix])

          self.fedmsg_config = fedmsg.config.load_config()

  

          super(WaiverDBHandler, self).__init__(hub, *args, **kwargs)

This is for our internal STOMP support. There, resultsdb messages publish on a different topic.

Oh yeah... hopefully gonna be 'resultsdb.result.new' soon in Fedora too :-)

:+1:

Would it be worth adding 'resultsdb_topic_suffix' and 'waiverdb_topic_suffix' to some example config? I am actually a bit unsure which config those need to go in... I assume fedmsg config, so somewhere in one of the /etc/fedmsg.d files right?

Yup, that's right. I'll doc it up.

1 new commit added

  • Make a note of new config values in the config files.
6 years ago

Pull-Request has been merged by ralph

6 years ago