def on_shutdown(self): for controller_name in self.controllers.keys(): print("Stopping controller: ", controller_name) req = StopController() req.controller_name = controller_name self.stop_controller(req) for serial_proxy in self.serial_proxies.values(): serial_proxy.disconnect()
def restart_controller(self, req): stop_req = StopController() stop_req.controller_name = req.controller_name response1 = self.stop_controller(stop_req) response2 = self.start_controller(req) res = RestartControllerResponse() res.success = response1.success and response2.success res.reason = '%s\n%s' % (response1.reason, response2.reason) return res