Commit 6e7664a5 authored by Nicolas Wavrant's avatar Nicolas Wavrant Committed by Alain Takoudjou

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

parent 80d13fb7
...@@ -263,10 +263,10 @@ def removeProxyDb(config): ...@@ -263,10 +263,10 @@ 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 slapgrid if not
""" """
# XXX-Marco what is 'config' for? # XXX-Marco what is 'config' for?
return isRunning('slapgrid-sr') return isRunning('slapos')
def runSoftwareWithLock(config, lock=True): def runSoftwareWithLock(config, lock=True):
...@@ -285,10 +285,10 @@ def runSoftwareWithLock(config, lock=True): ...@@ -285,10 +285,10 @@ 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='slapos')
if lock: if lock:
slapgrid.wait() slapgrid.wait()
#Saves the current compile software for re-use #Saves the current compile software for re-use
...@@ -354,10 +354,10 @@ def loadSoftwareRList(config): ...@@ -354,10 +354,10 @@ 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('slapos')
def runInstanceWithLock(config, lock=True): def runInstanceWithLock(config, lock=True):
...@@ -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='slapos')
if lock: if lock:
slapgrid.wait() slapgrid.wait()
return ( True if slapgrid.returncode == 0 else False ) return ( True if slapgrid.returncode == 0 else False )
...@@ -515,9 +515,9 @@ def configNewSR(config, projectpath): ...@@ -515,9 +515,9 @@ def configNewSR(config, projectpath):
folder = realpath(config, projectpath) folder = realpath(config, projectpath)
if folder: if folder:
if isInstanceRunning(): if isInstanceRunning():
killRunningProcess('slapgrid-cp') killRunningProcess('slapos')
if isSoftwareRunning(): if isSoftwareRunning():
killRunningProcess('slapgrid-sr') killRunningProcess('slapos')
stopProxy(config) stopProxy(config)
removeProxyDb(config) removeProxyDb(config)
startProxy(config) startProxy(config)
...@@ -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