mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 21:41:32 +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:
|
||||
supervisor = xmlrpc.client.ServerProxy(tfwenv.SUPERVISOR_HTTP_URI).supervisor
|
||||
|
||||
def stop_process(self):
|
||||
def stop_process(self, process_name):
|
||||
with suppress(SupervisorFault):
|
||||
self.supervisor.stopProcess(self.process_name)
|
||||
self.supervisor.stopProcess(process_name)
|
||||
|
||||
def start_process(self):
|
||||
self.supervisor.startProcess(self.process_name)
|
||||
def start_process(self, process_name):
|
||||
self.supervisor.startProcess(process_name)
|
||||
|
||||
def restart_process(self):
|
||||
self.stop_process()
|
||||
self.start_process()
|
||||
def restart_process(self, process_name):
|
||||
self.stop_process(process_name)
|
||||
self.start_process(process_name)
|
||||
|
Loading…
Reference in New Issue
Block a user