tweaks and logging
@@ -753,22 +753,24 @@ class Monitor(object):
global CTRL_C
CTRL_C['STOP'] = True
self.logger.debug('CTRL-C: {0}'.format(CTRL_C))
+ if isinstance(self.s.sdnc, FaucetProxy):
+ Parser().clear_mirrors(self.controller['CONFIG_FILE'])
+ elif isinstance(self.s.sdnc, BcfProxy):
+ self.s.sdnc.remove_filter_rules()
+
try:
for job in self.schedule.jobs:
self.logger.debug('CTRLC:{0}'.format(job))
self.schedule.cancel_job(job)
self.rabbit_channel_connection_local.close()
self.rabbit_channel_connection_local_fa.close()
- if isinstance(self.s.sdnc, FaucetProxy):
- Parser().clear_mirrors(self.controller['CONFIG_FILE'])
- elif isinstance(self.s.sdnc, BcfProxy):
- self.s.sdnc.remove_filter_rules()
self.logger.debug('SHUTTING DOWN')
self.logger.debug('EXITING')
sys.exit()
- except BaseException: # pragma: no cover
- pass
+ except Exception as e: # pragma: no cover
+ self.logger.error(
+ 'Failed to handle signal properly because: {0}'.format(str(e)))
def main(skip_rabbit=False): # pragma: no cover
