def stop(self): if self.state != RUNNING: raise Exception("Not running") self.state = READY supervisor.stop_service(self.name) supervisor.gen_conf() supervisor.reload() self.setup_nginx_config()
def start(self): if self.state != READY: raise Exception("Not ready") self.state = RUNNING supervisor.gen_conf() supervisor.reload() supervisor.start_service(self.name) self.setup_nginx_config()