def shutdown(signum = None, frame = None): with stopLock: global stopped if stopped: return else: stopped = True logging.getLogger().info("Shutting down probe") Scheduler.quit() if Params.COMMANDER and commander is not None: commander.quit() from calls.actions import Quit if Params.WATCHERS: WatcherManager.stopWatchers() from managers.probetests import TestManager, TestResponder TestManager.stopTests() TestResponder.stopTests() if actionMan is not None: ActionMan.addTask(Quit()) if server is not None: server.quit() if actionMan is not None: actionMan.quit() #everybody might need the client so stop it last if client is not None: client.quit()
def shutdown(signum=None, frame=None): with stopLock: global stopped if stopped: return else: stopped = True logging.getLogger().info("Shutting down probe") Scheduler.quit() if Params.COMMANDER and commander is not None: commander.quit() from calls.actions import Quit if Params.WATCHERS: WatcherManager.stopWatchers() from managers.probetests import TestManager, TestResponder TestManager.stopTests() TestResponder.stopTests() if actionMan is not None: ActionMan.addTask(Quit()) if server is not None: server.quit() if actionMan is not None: actionMan.quit() #everybody might need the client so stop it last if client is not None: client.quit()
def treatTestMessage(cls, message): """Treats a test message which can be Testee or Tester kind Testee are given to TesteeManager Tester are given to testResponder :param message: testMessage to treat """ cls.logger.ddebug("Handling Tester or Testee message") assert isinstance(message, TestMessage) # if probe is in test mode, give the message right to the TestManager! if isinstance(message, TesteeAnswer): cls.logger.ddebug("Handling TesteeAnswer") TestManager.handleMessage(message) elif isinstance(message, TesterMessage): cls.logger.ddebug("Handling TesterMessage") TestResponder.handleMessage(message) elif isinstance(message, TestMessage): #Prepare are test messages ActionMan.addTask(MTA.toAction(message))