Fix UnboundLocalError.

I have hotfixed this in production on mbs-backend01::

    Traceback (most recent call last):
      File "module_build_service/scheduler/consumer.py", line 134, in consume
        self.process_message(session, msg)
      File "module_build_service/scheduler/consumer.py", line 224, in process_message
        for event in further_work:
    UnboundLocalError: local variable 'further_work' referenced before assignment
This commit is contained in:
Ralph Bean
2017-03-22 13:10:34 -04:00
parent f743aefe5a
commit aabd28b148

View File

@@ -203,6 +203,7 @@ class MBSConsumer(fedmsg.consumers.FedmsgConsumer):
log.debug("Handler is NO_OP: %s" % idx)
else:
log.debug("Calling %s" % idx)
further_work = []
try:
further_work = handler(conf, session, msg) or []
except ValidationError as e: