Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.toolbox
Commits
91280c0e
Commit
91280c0e
authored
Feb 13, 2014
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner: stopSlapgrid do not only stop one try of runSlagridUntilSuccess
parent
873554fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
slapos/runner/utils.py
slapos/runner/utils.py
+8
-0
slapos/runner/views.py
slapos/runner/views.py
+2
-0
No files found.
slapos/runner/utils.py
View file @
91280c0e
...
...
@@ -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
...
...
slapos/runner/views.py
View file @
91280c0e
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment