Commit 91280c0e authored by Nicolas Wavrant's avatar Nicolas Wavrant

runner: stopSlapgrid do not only stop one try of runSlagridUntilSuccess

parent 873554fd
......@@ -828,6 +828,8 @@ def runSlapgridUntilSuccess(config, step):
runSlapgridWithLock = runSoftwareWithLock
else:
return -1
counter_file = os.path.join(config['runner_workdir'], '.turn-left')
open(counter_file, 'w+').write(str(max_tries))
counter = max_tries
slapgrid = True
# XXX-Nico runSoftwareWithLock can return 0 or False (0==False)
......@@ -836,6 +838,12 @@ def runSlapgridUntilSuccess(config, step):
slapgrid = runSlapgridWithLock(config)
if slapgrid:
break
times_left = int(open(counter_file).read()) - 1
if times_left > 0 :
open(counter_file, 'w+').write(str(times_left))
counter = times_left
else :
counter = 0
max_tries -= counter
# run instance only if we are deploying the software release,
# if it is defined so, and sr is correctly deployed
......
......@@ -453,6 +453,8 @@ def slapgridResult():
def stopSlapgrid():
counter_file = os.path.join(app.config['runner_workdir'], '.turn-left')
open(counter_file, 'w+').write(str(0))
result = killRunningProcess(request.form['type'])
return jsonify(result=result)
......
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