#48 Optionally listen to the message bus.
Closed 5 years ago by ralph. Opened 5 years ago by ralph.

file modified
+6
@@ -19,7 +19,13 @@ 

  

  config = {

      'sync2jira': {

+         # Scrape sources at startup

          'initialize': True,

+ 

+         # Listen on the message bus

+         'listen': True,

+ 

+         # Don't actually make changes to JIRA...

          'testing': True,

  

          'legacy_matching': False,

file modified
+11
@@ -75,10 +75,21 @@ 

      if 'jira' not in config['sync2jira']:

          raise ValueError("No sync2jira.jira section found in fedmsg.d/ config")

  

+     # Provide some default values

+     defaults = {

+         'listen': True,

+     }

+     for key, value in defaults.items():

+         config['sync2jira'][key] = config['sync2jira'].get(key, value)

+ 

      return config

  

  

  def listen(config):

+     if not config['sync2jira'].get('listen'):

+         log.info("`listen` is disabled.  Exiting.")

+         return

+ 

      log.info("Waiting for a relevant fedmsg message to arrive...")

      for _, _, topic, msg in fedmsg.tail_messages(**config):

          idx = msg['msg_id']

For development purposes.

Pull-Request has been closed by ralph

5 years ago