Commit 072b4551 authored by Nicolas Wavrant's avatar Nicolas Wavrant Committed by Cédric Le Ninivin

runner: uses slapos instead of legacy slapgrid-cp and slapgrid-sr

slaprunner: fix regression on process names

runner: fix call to kill slapgrid in configNewSR
parent d9283bcd
...@@ -263,7 +263,7 @@ def removeProxyDb(config): ...@@ -263,7 +263,7 @@ def removeProxyDb(config):
def isSoftwareRunning(config=None): def isSoftwareRunning(config=None):
""" """
Return True if slapgrid-sr is still running and false if slapgrid if not Return True if slapos is still running and false if slapos if not
""" """
# XXX-Marco what is 'config' for? # XXX-Marco what is 'config' for?
return isRunning('slapgrid-sr') return isRunning('slapgrid-sr')
...@@ -285,9 +285,9 @@ def runSoftwareWithLock(config, lock=True): ...@@ -285,9 +285,9 @@ def runSoftwareWithLock(config, lock=True):
logfile = open(config['software_log'], 'w') logfile = open(config['software_log'], 'w')
if not updateProxy(config): if not updateProxy(config):
return False return False
slapgrid = Popen([config['slapgrid_sr'], '-vc', slapgrid = Popen([config['slapos'], 'node', 'software', '--all',
'--pidfile', slapgrid_pid, '--cfg', config['slapos_cfg'], '--pidfile', slapgrid_pid,
config['configuration_file_path'], '--now', '--develop'], '--verbose', '--logfile', config['software_log']],
stdout=logfile, name='slapgrid-sr') stdout=logfile, name='slapgrid-sr')
if lock: if lock:
slapgrid.wait() slapgrid.wait()
...@@ -354,7 +354,7 @@ def loadSoftwareRList(config): ...@@ -354,7 +354,7 @@ def loadSoftwareRList(config):
def isInstanceRunning(config=None): def isInstanceRunning(config=None):
""" """
Return True if slapgrid-cp is still running and False otherwise Return True if slapos is still running and False otherwise
""" """
# XXX-Marco what is 'config' for? # XXX-Marco what is 'config' for?
return isRunning('slapgrid-cp') return isRunning('slapgrid-cp')
...@@ -373,10 +373,10 @@ def runInstanceWithLock(config, lock=True): ...@@ -373,10 +373,10 @@ def runInstanceWithLock(config, lock=True):
logfile = open(config['instance_log'], 'w') logfile = open(config['instance_log'], 'w')
if not (updateProxy(config) and requestInstance(config)): if not (updateProxy(config) and requestInstance(config)):
return False return False
slapgrid = Popen([config['slapgrid_cp'], '-vc', slapgrid = Popen([config['slapos'], 'node', 'instance', '--all',
'--pidfile', slapgrid_pid, '--cfg', config['slapos_cfg'], '--pidfile', slapgrid_pid,
config['configuration_file_path'], '--now'], '--verbose', '--logfile', config['instance_log']],
stdout=logfile, name='slapgrid-cp') stdout=logfile, name='slapgrid-cp')
if lock: if lock:
slapgrid.wait() slapgrid.wait()
return ( True if slapgrid.returncode == 0 else False ) return ( True if slapgrid.returncode == 0 else False )
...@@ -827,7 +827,7 @@ def buildAndRun(config): ...@@ -827,7 +827,7 @@ def buildAndRun(config):
def runSlapgridUntilSuccess(config, step): def runSlapgridUntilSuccess(config, step):
"""Run slapgrid-sr or slapgrid-cp several times, """Run slapos several times,
in the maximum of the constant MAX_RUN_~~~~""" in the maximum of the constant MAX_RUN_~~~~"""
params = getBuildAndRunParams(config) params = getBuildAndRunParams(config)
if step == "instance": if step == "instance":
......
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