Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Lu Xu
erp5
Commits
e267ed79
Commit
e267ed79
authored
Feb 14, 2012
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SR may fail for number of reasons (incl. network failures)
so be tolerant and run it a few times before giving up.
parent
2bebae7a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
erp5/util/testnode/SlapOSControler.py
erp5/util/testnode/SlapOSControler.py
+10
-5
No files found.
erp5/util/testnode/SlapOSControler.py
View file @
e267ed79
...
@@ -31,6 +31,7 @@ import time
...
@@ -31,6 +31,7 @@ import time
import
xml_marshaller
import
xml_marshaller
MAX_PARTIONS
=
10
MAX_PARTIONS
=
10
MAX_SR_RETRIES
=
3
class
SlapOSControler
(
object
):
class
SlapOSControler
(
object
):
...
@@ -95,11 +96,15 @@ class SlapOSControler(object):
...
@@ -95,11 +96,15 @@ class SlapOSControler(object):
command
=
[
config
[
'slapgrid_software_binary'
],
'-v'
,
'-c'
,
command
=
[
config
[
'slapgrid_software_binary'
],
'-v'
,
'-c'
,
#'--buildout-parameter',"'-U -N' -o",
#'--buildout-parameter',"'-U -N' -o",
config
[
'slapos_config'
]]
config
[
'slapos_config'
]]
# a SR may fail for number of reasons (incl. network failures)
# so be tolerant and run it a few times before giving up
for
runs
in
range
(
0
,
MAX_SR_RETRIES
):
slapgrid
=
subprocess
.
Popen
(
command
,
slapgrid
=
subprocess
.
Popen
(
command
,
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
)
...
...
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