Commit 81ec6cab authored by Sebastien Robin's avatar Sebastien Robin

using subprocess.PIPE was a bad idea, buildout was so slow.

Use real files instead
parent ddfe3e8e
from setuptools import setup, find_packages
name = "erp5.recipe.testnode"
version = '1.0.13'
version = '1.0.16'
def read(name):
return open(name).read()
......
......@@ -5,7 +5,6 @@ class SlapOSControler(object):
def __init__(self, config, process_group_pid_list=None):
self.config = config
self.process_group_pid_list = []
# By erasing everything, we make sure that we are able to "update"
# existing profiles. This is quite dirty way to do updates...
if os.path.exists(config['proxy_database']):
......@@ -53,17 +52,26 @@ class SlapOSControler(object):
cpu_count = os.sysconf("SC_NPROCESSORS_ONLN")
os.putenv('MAKEFLAGS', '-j%s' % cpu_count)
os.environ['PATH'] = environment['PATH']
stdout = open(os.path.join(
config['instance_root'],'.runSoftwareRelease_out'),
'w+')
stderr = open(os.path.join(
config['instance_root'],'.runSoftwareRelease_err'),
'w+')
slapgrid = subprocess.Popen([config['slapgrid_software_binary'], '-v', '-c',
#'--buildout-parameter',"'-U -N' -o",
config['slapos_config']],
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
stdout=stdout, stderr=stderr,
close_fds=True, preexec_fn=os.setsid)
process_group_pid_list.append(slapgrid.pid)
slapgrid.wait()
stdout, stderr = slapgrid.communicate()
stdout.seek(0)
stderr.seek(0)
status_dict = {'status_code':slapgrid.returncode,
'stdout':stdout,
'stderr':stderr}
'stdout':stdout.read(),
'stderr':stderr.read()}
stdout.close()
stderr.close()
return status_dict
def runComputerPartition(self, config, process_group_pid_list=None):
......
......@@ -109,9 +109,10 @@ repository = %(repository_path)s
updater = Updater(repository_path, git_binary=config['git_binary'])
updater.checkout()
revision = updater.getRevision()
if not(retry_software) and previous_revision == revision:
if previous_revision == revision:
time.sleep(120)
continue
if not(retry_software):
continue
retry_software = False
previous_revision = revision
......
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