示例#1
0
文件: base.py 项目: yafphp/supervisor
 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)
示例#2
0
文件: base.py 项目: yafphp/supervisor
 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:]
示例#3
0
 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:]
示例#4
0
文件: base.py 项目: yafphp/supervisor
    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
示例#5
0
文件: base.py 项目: yafphp/supervisor
 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')
示例#6
0
文件: base.py 项目: yafphp/supervisor
 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]
示例#7
0
 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'},
         ]
示例#8
0
文件: base.py 项目: yafphp/supervisor
 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
示例#9
0
文件: base.py 项目: yafphp/supervisor
 def clearProcessStdoutLog(self, name):
     from supervisor import xmlrpc
     if name == 'BAD_NAME':
         raise Fault(xmlrpc.Faults.BAD_NAME, 'BAD_NAME')
     return True
示例#10
0
文件: base.py 项目: yafphp/supervisor
 def shutdown(self):
     if self._restartable:
         self._shutdown = True
         return
     from supervisor import xmlrpc
     raise Fault(xmlrpc.Faults.SHUTDOWN_STATE, '')
示例#11
0
文件: base.py 项目: yafphp/supervisor
 def readLog(self, whence, offset):
     if self._readlog_error:
         raise Fault(self._readlog_error, '')
     return 'mainlogdata'