|
@@ -141,7 +141,7 @@ class DummyOptions:
|
|
def get_pid(self):
|
|
def get_pid(self):
|
|
import os
|
|
import os
|
|
return os.getpid()
|
|
return os.getpid()
|
|
-
|
|
|
|
|
|
+
|
|
def check_execv_args(self, filename, argv, st):
|
|
def check_execv_args(self, filename, argv, st):
|
|
if filename == '/bad/filename':
|
|
if filename == '/bad/filename':
|
|
from supervisor.options import NotFound
|
|
from supervisor.options import NotFound
|
|
@@ -265,7 +265,7 @@ class DummyLogger:
|
|
if kw:
|
|
if kw:
|
|
msg = msg % kw
|
|
msg = msg % kw
|
|
self.data.append(msg)
|
|
self.data.append(msg)
|
|
-
|
|
|
|
|
|
+
|
|
def reopen(self):
|
|
def reopen(self):
|
|
self.reopened = True
|
|
self.reopened = True
|
|
def close(self):
|
|
def close(self):
|
|
@@ -348,7 +348,7 @@ class DummySocketManager:
|
|
|
|
|
|
def get_socket(self):
|
|
def get_socket(self):
|
|
return DummySocket(self._config.fd)
|
|
return DummySocket(self._config.fd)
|
|
-
|
|
|
|
|
|
+
|
|
class DummyProcess:
|
|
class DummyProcess:
|
|
# Initial state; overridden by instance variables
|
|
# Initial state; overridden by instance variables
|
|
pid = 0 # Subprocess pid; 0 when not running
|
|
pid = 0 # Subprocess pid; 0 when not running
|
|
@@ -545,7 +545,7 @@ def makeExecutable(file, substitutions=None):
|
|
import os
|
|
import os
|
|
import sys
|
|
import sys
|
|
import tempfile
|
|
import tempfile
|
|
-
|
|
|
|
|
|
+
|
|
if substitutions is None:
|
|
if substitutions is None:
|
|
substitutions = {}
|
|
substitutions = {}
|
|
data = open(file).read()
|
|
data = open(file).read()
|
|
@@ -554,7 +554,7 @@ def makeExecutable(file, substitutions=None):
|
|
substitutions['PYTHON'] = sys.executable
|
|
substitutions['PYTHON'] = sys.executable
|
|
for key in substitutions.keys():
|
|
for key in substitutions.keys():
|
|
data = data.replace('<<%s>>' % key.upper(), substitutions[key])
|
|
data = data.replace('<<%s>>' % key.upper(), substitutions[key])
|
|
-
|
|
|
|
|
|
+
|
|
tmpnam = tempfile.mktemp(prefix=last)
|
|
tmpnam = tempfile.mktemp(prefix=last)
|
|
f = open(tmpnam, 'w')
|
|
f = open(tmpnam, 'w')
|
|
f.write(data)
|
|
f.write(data)
|
|
@@ -636,7 +636,7 @@ class DummyRequest:
|
|
|
|
|
|
def get_server_url(self):
|
|
def get_server_url(self):
|
|
return 'http://example.com'
|
|
return 'http://example.com'
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
class DummyRPCInterfaceFactory:
|
|
class DummyRPCInterfaceFactory:
|
|
def __init__(self, supervisord, **config):
|
|
def __init__(self, supervisord, **config):
|
|
@@ -803,9 +803,9 @@ class DummySupervisorRPCNamespace:
|
|
raise Fault(xmlrpc.Faults.NOT_RUNNING, 'NOT_RUNNING')
|
|
raise Fault(xmlrpc.Faults.NOT_RUNNING, 'NOT_RUNNING')
|
|
if name == 'FAILED':
|
|
if name == 'FAILED':
|
|
raise Fault(xmlrpc.Faults.FAILED, 'FAILED')
|
|
raise Fault(xmlrpc.Faults.FAILED, 'FAILED')
|
|
-
|
|
|
|
|
|
+
|
|
return True
|
|
return True
|
|
-
|
|
|
|
|
|
+
|
|
def stopAllProcesses(self):
|
|
def stopAllProcesses(self):
|
|
from supervisor import xmlrpc
|
|
from supervisor import xmlrpc
|
|
return [
|
|
return [
|
|
@@ -936,15 +936,15 @@ class DummyProcessGroup:
|
|
|
|
|
|
def stop_all(self):
|
|
def stop_all(self):
|
|
self.all_stopped = True
|
|
self.all_stopped = True
|
|
-
|
|
|
|
|
|
+
|
|
def get_unstopped_processes(self):
|
|
def get_unstopped_processes(self):
|
|
return self.unstopped_processes
|
|
return self.unstopped_processes
|
|
|
|
|
|
def get_dispatchers(self):
|
|
def get_dispatchers(self):
|
|
return self.dispatchers
|
|
return self.dispatchers
|
|
-
|
|
|
|
|
|
+
|
|
class DummyFCGIProcessGroup(DummyProcessGroup):
|
|
class DummyFCGIProcessGroup(DummyProcessGroup):
|
|
-
|
|
|
|
|
|
+
|
|
def __init__(self, config):
|
|
def __init__(self, config):
|
|
DummyProcessGroup.__init__(self, config)
|
|
DummyProcessGroup.__init__(self, config)
|
|
self.socket_manager = DummySocketManager(config.socket_config)
|
|
self.socket_manager = DummySocketManager(config.socket_config)
|
|
@@ -1012,7 +1012,7 @@ class DummyDispatcher:
|
|
if self.flush_error:
|
|
if self.flush_error:
|
|
raise OSError(self.flush_error)
|
|
raise OSError(self.flush_error)
|
|
self.flushed = True
|
|
self.flushed = True
|
|
-
|
|
|
|
|
|
+
|
|
class DummyStream:
|
|
class DummyStream:
|
|
def __init__(self, error=None):
|
|
def __init__(self, error=None):
|
|
self.error = error
|
|
self.error = error
|
|
@@ -1033,7 +1033,7 @@ class DummyStream:
|
|
pass
|
|
pass
|
|
def tell(self):
|
|
def tell(self):
|
|
return len(self.written)
|
|
return len(self.written)
|
|
-
|
|
|
|
|
|
+
|
|
class DummyEvent:
|
|
class DummyEvent:
|
|
def __init__(self, serial='abc'):
|
|
def __init__(self, serial='abc'):
|
|
if serial is not None:
|
|
if serial is not None:
|
|
@@ -1041,7 +1041,7 @@ class DummyEvent:
|
|
|
|
|
|
def __str__(self):
|
|
def __str__(self):
|
|
return 'dummy event'
|
|
return 'dummy event'
|
|
-
|
|
|
|
|
|
+
|
|
def dummy_handler(event, result):
|
|
def dummy_handler(event, result):
|
|
pass
|
|
pass
|
|
|
|
|