def stop(): """Stop all services.""" for service in manager.get_all(): try: service.stop() except Exception, exc: log.exception('Exception %s while %s stop' % (exc, service))
def stop(): """Stop all services.""" for service in manager.get_all(): try: service.stop() except Exception, exc: log.exception("Exception %s while %s stop" % (exc, service))
def start(): """Start all services.""" failed = [] for service in manager.get_all(): try: service.start() except Exception, exc: log.exception('Exception %s while %s start' % (exc, service)) failed.append(service)
def start(): """Start all services.""" failed = [] for service in manager.get_all(): try: service.start() except Exception, exc: log.exception("Exception %s while %s start" % (exc, service)) failed.append(service)
def setup(config): """Import and setup all services.""" global __CONFIG if not __CONFIG: # First time start, we are im main-thread - register signal handlers signal.signal(signal.SIGINT, interrupt_handler) signal.signal(signal.SIGTERM, interrupt_handler) # and required actions actions.register(name='exit')(exit_pywo) actions.register(name='reload')(reload_pywo) __CONFIG = config WM.update_type() manager.load(__CONFIG) failed = [] for service in manager.get_all(): try: service.setup(config) except Exception, exc: log.exception('Exception %s while %s setup' % (exc, service)) failed.append(service)
def setup(config): """Import and setup all services.""" global __CONFIG if not __CONFIG: # First time start, we are im main-thread - register signal handlers signal.signal(signal.SIGINT, interrupt_handler) signal.signal(signal.SIGTERM, interrupt_handler) # and required actions actions.register(name="exit")(exit_pywo) actions.register(name="reload")(reload_pywo) __CONFIG = config WM.update_type() manager.load(__CONFIG) failed = [] for service in manager.get_all(): try: service.setup(config) except Exception, exc: log.exception("Exception %s while %s setup" % (exc, service)) failed.append(service)