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
Lisa Casino
slapos.toolbox
Commits
d13ea3cb
Commit
d13ea3cb
authored
Aug 11, 2016
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner: sup_process functions now return command status from supervisorctl calls
parent
2282ddda
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
slapos/runner/sup_process.py
slapos/runner/sup_process.py
+9
-4
slapos/runner/utils.py
slapos/runner/utils.py
+2
-2
No files found.
slapos/runner/sup_process.py
View file @
d13ea3cb
...
...
@@ -44,7 +44,7 @@ def runProcess(config, process):
Start a process registered by supervisor
"""
server
=
xmlrpclib
.
Server
(
config
[
'supervisord_server'
])
server
.
supervisor
.
startProcess
(
process
)
return
server
.
supervisor
.
startProcess
(
process
)
def
runProcesses
(
config
,
processes
):
...
...
@@ -63,16 +63,21 @@ def stopProcess(config, process):
"""
if
isRunning
(
config
,
process
):
server
=
xmlrpclib
.
Server
(
config
[
'supervisord_server'
])
server
.
supervisor
.
stopProcess
(
process
)
return
server
.
supervisor
.
stopProcess
(
process
)
def
stopProcesses
(
config
,
processes
):
"""
Stop a list of processes
Stop a list of processes.
Returns True if all the processes have ended correctly.
Returns False if at least one process didn't stop correctly.
"""
server
=
xmlrpclib
.
Server
(
config
[
'supervisord_server'
])
return_status_list
=
[]
for
proc
in
processes
:
server
.
supervisor
.
stopProcess
(
proc
)
return_status_list
.
append
(
server
.
supervisor
.
stopProcess
(
proc
))
return
len
(
return_status_list
)
==
sum
(
return_status_list
)
def
waitForProcessEnd
(
config
,
process
):
...
...
slapos/runner/utils.py
View file @
d13ea3cb
...
...
@@ -231,7 +231,7 @@ def startProxy(config):
if
sup_process
.
isRunning
(
config
,
'slapproxy'
):
return
try
:
sup_process
.
runProcess
(
config
,
"slapproxy"
)
return
sup_process
.
runProcess
(
config
,
"slapproxy"
)
except
xmlrpclib
.
Fault
:
pass
time
.
sleep
(
4
)
...
...
@@ -239,7 +239,7 @@ def startProxy(config):
def
stopProxy
(
config
):
"""Stop Slapproxy server"""
sup_process
.
stopProcess
(
config
,
"slapproxy"
)
return
sup_process
.
stopProcess
(
config
,
"slapproxy"
)
def
removeProxyDb
(
config
):
...
...
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