Commit cfd04459 authored by Sebastien Robin's avatar Sebastien Robin

while true loop is useless, it is already done in testnode.py

parent 66d8122d
...@@ -48,32 +48,31 @@ class SlapOSControler(object): ...@@ -48,32 +48,31 @@ class SlapOSControler(object):
def runSoftwareRelease(self, config, environment, process_group_pid_set=None): def runSoftwareRelease(self, config, environment, process_group_pid_set=None):
print "SlapOSControler.runSoftwareRelease" print "SlapOSControler.runSoftwareRelease"
while True: cpu_count = os.sysconf("SC_NPROCESSORS_ONLN")
cpu_count = os.sysconf("SC_NPROCESSORS_ONLN") os.putenv('MAKEFLAGS', '-j%s' % cpu_count)
os.putenv('MAKEFLAGS', '-j%s' % cpu_count) os.environ['PATH'] = environment['PATH']
os.environ['PATH'] = environment['PATH'] stdout = open(os.path.join(
stdout = open(os.path.join( config['instance_root'],'.runSoftwareRelease_out'),
config['instance_root'],'.runSoftwareRelease_out'), 'w+')
'w+') stderr = open(os.path.join(
stderr = open(os.path.join( config['instance_root'],'.runSoftwareRelease_err'),
config['instance_root'],'.runSoftwareRelease_err'), 'w+')
'w+') slapgrid = subprocess.Popen([config['slapgrid_software_binary'], '-v', '-c',
slapgrid = subprocess.Popen([config['slapgrid_software_binary'], '-v', '-c', #'--buildout-parameter',"'-U -N' -o",
#'--buildout-parameter',"'-U -N' -o", config['slapos_config']],
config['slapos_config']], stdout=stdout, stderr=stderr,
stdout=stdout, stderr=stderr, close_fds=True, preexec_fn=os.setsid)
close_fds=True, preexec_fn=os.setsid) process_group_pid_set.add(slapgrid.pid)
process_group_pid_set.add(slapgrid.pid) slapgrid.wait()
slapgrid.wait() stdout.seek(0)
stdout.seek(0) stderr.seek(0)
stderr.seek(0) process_group_pid_set.remove(slapgrid.pid)
process_group_pid_set.remove(slapgrid.pid) status_dict = {'status_code':slapgrid.returncode,
status_dict = {'status_code':slapgrid.returncode, 'stdout':stdout.read(),
'stdout':stdout.read(), 'stderr':stderr.read()}
'stderr':stderr.read()} stdout.close()
stdout.close() stderr.close()
stderr.close() return status_dict
return status_dict
def runComputerPartition(self, config, process_group_pid_set=None): def runComputerPartition(self, config, process_group_pid_set=None):
print "SlapOSControler.runSoftwareRelease" print "SlapOSControler.runSoftwareRelease"
......
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