Commit cbd211cd authored by Nicolas Wavrant's avatar Nicolas Wavrant

runner: merge 2 functions stopping a process

parent 59598125
......@@ -39,15 +39,13 @@ def runProcesses(config, processes):
waitForProcessEnd(proc)
def stopIfRunning(config, process):
def stopProcess(config, process):
"""
Ask supervisor to stop a process
"""
if isRunning(config, process):
server = xmlrpclib.Server(config['supervisord_server'])
slapos.stopProcess(process)
def stopProcess(config, process):
server = xmlrpclib.Server(config['supervisord_server'])
server.supervisor.stopProcess(process)
server.supervisor.stopProcess(process)
def stopProcesses(config, processes):
......
......@@ -547,8 +547,8 @@ def configNewSR(config, projectpath):
"""
folder = realpath(config, projectpath)
if folder:
sup_process.stopIfRunning(config, 'slapgrid-cp')
sup_process.stopIfRunning(config, 'slapgrid-sr')
sup_process.stopProcess(config, 'slapgrid-cp')
sup_process.stopProcess(config, 'slapgrid-sr')
stopProxy(config)
removeProxyDb(config)
startProxy(config)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment