def removeProcessGroup(self, name): from supervisor import xmlrpc if name == 'STILL_RUNNING': raise Fault(xmlrpc.Faults.STILL_RUNNING, '') if name == 'BAD_NAME': raise Fault(xmlrpc.Faults.BAD_NAME, '') if name == 'FAILED': raise Fault(xmlrpc.Faults.FAILED, '') self.processes.remove(name)
def readProcessStdoutLog(self, name, offset, length): from supervisor import xmlrpc if name == 'BAD_NAME': raise Fault(xmlrpc.Faults.BAD_NAME, 'BAD_NAME') elif name == 'FAILED': raise Fault(xmlrpc.Faults.FAILED, 'FAILED') elif name == 'NO_FILE': raise Fault(xmlrpc.Faults.NO_FILE, 'NO_FILE') a = 'output line\n' * 10 return a[offset:]
def _read_log(self, channel, name, offset, length): from supervisor import xmlrpc if name == 'BAD_NAME': raise Fault(xmlrpc.Faults.BAD_NAME, 'BAD_NAME') elif name == 'FAILED': raise Fault(xmlrpc.Faults.FAILED, 'FAILED') elif name == 'NO_FILE': raise Fault(xmlrpc.Faults.NO_FILE, 'NO_FILE') a = (channel + ' line\n') * 10 return a[offset:]
def stopProcess(self, name): from supervisor import xmlrpc if name == 'BAD_NAME:BAD_NAME': raise Fault(xmlrpc.Faults.BAD_NAME, 'BAD_NAME:BAD_NAME') if name == 'BAD_NAME': raise Fault(xmlrpc.Faults.BAD_NAME, 'BAD_NAME') if name == 'NOT_RUNNING': raise Fault(xmlrpc.Faults.NOT_RUNNING, 'NOT_RUNNING') if name == 'FAILED': raise Fault(xmlrpc.Faults.FAILED, 'FAILED') return True
def getProcessInfo(self, name): from supervisor import xmlrpc for i in self.all_process_info: if i['name'] == name: info = i return info if name == 'BAD_NAME': raise Fault(xmlrpc.Faults.BAD_NAME, 'BAD_NAME') if name == 'FAILED': raise Fault(xmlrpc.Faults.FAILED, 'FAILED') if name == 'NO_FILE': raise Fault(xmlrpc.Faults.NO_FILE, 'NO_FILE')
def addProcessGroup(self, name): from supervisor import xmlrpc if name == 'ALREADY_ADDED': raise Fault(xmlrpc.Faults.ALREADY_ADDED, '') if name == 'BAD_NAME': raise Fault(xmlrpc.Faults.BAD_NAME, '') if name == 'FAILED': raise Fault(xmlrpc.Faults.FAILED, '') if name == 'SHUTDOWN_STATE': raise Fault(xmlrpc.Faults.SHUTDOWN_STATE, '') if hasattr(self, 'processes'): self.processes.append(name) else: self.processes = [name]
def stopProcessGroup(self, name): from supervisor import xmlrpc from supervisor.compat import Fault if name == 'BAD_NAME': raise Fault(xmlrpc.Faults.BAD_NAME, 'BAD_NAME') return [ {'name':'foo_00', 'group':'foo', 'status': xmlrpc.Faults.SUCCESS, 'description': 'OK'}, {'name':'foo_01', 'group':'foo', 'status':xmlrpc.Faults.SUCCESS, 'description': 'OK'}, ]
def startProcess(self, name): from supervisor import xmlrpc if name == 'BAD_NAME:BAD_NAME': raise Fault(xmlrpc.Faults.BAD_NAME, 'BAD_NAME:BAD_NAME') if name == 'BAD_NAME': raise Fault(xmlrpc.Faults.BAD_NAME, 'BAD_NAME') if name == 'NO_FILE': raise Fault(xmlrpc.Faults.NO_FILE, 'NO_FILE') if name == 'NOT_EXECUTABLE': raise Fault(xmlrpc.Faults.NOT_EXECUTABLE, 'NOT_EXECUTABLE') if name == 'ALREADY_STARTED': raise Fault(xmlrpc.Faults.ALREADY_STARTED, 'ALREADY_STARTED') if name == 'SPAWN_ERROR': raise Fault(xmlrpc.Faults.SPAWN_ERROR, 'SPAWN_ERROR') if name == 'ABNORMAL_TERMINATION': raise Fault(xmlrpc.Faults.ABNORMAL_TERMINATION, 'ABNORMAL_TERMINATION') return True
def clearProcessStdoutLog(self, name): from supervisor import xmlrpc if name == 'BAD_NAME': raise Fault(xmlrpc.Faults.BAD_NAME, 'BAD_NAME') return True
def shutdown(self): if self._restartable: self._shutdown = True return from supervisor import xmlrpc raise Fault(xmlrpc.Faults.SHUTDOWN_STATE, '')
def readLog(self, whence, offset): if self._readlog_error: raise Fault(self._readlog_error, '') return 'mainlogdata'