mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 21:31:31 +00:00
Refactor SupervisorMixin to be stateless
This commit is contained in:
parent
57bd2aec45
commit
789db7416d
@ -8,13 +8,13 @@ from tfw.config import tfwenv
|
|||||||
class SupervisorMixin:
|
class SupervisorMixin:
|
||||||
supervisor = xmlrpc.client.ServerProxy(tfwenv.SUPERVISOR_HTTP_URI).supervisor
|
supervisor = xmlrpc.client.ServerProxy(tfwenv.SUPERVISOR_HTTP_URI).supervisor
|
||||||
|
|
||||||
def stop_process(self):
|
def stop_process(self, process_name):
|
||||||
with suppress(SupervisorFault):
|
with suppress(SupervisorFault):
|
||||||
self.supervisor.stopProcess(self.process_name)
|
self.supervisor.stopProcess(process_name)
|
||||||
|
|
||||||
def start_process(self):
|
def start_process(self, process_name):
|
||||||
self.supervisor.startProcess(self.process_name)
|
self.supervisor.startProcess(process_name)
|
||||||
|
|
||||||
def restart_process(self):
|
def restart_process(self, process_name):
|
||||||
self.stop_process()
|
self.stop_process(process_name)
|
||||||
self.start_process()
|
self.start_process(process_name)
|
||||||
|
Loading…
Reference in New Issue
Block a user