Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_rtl_support
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
erp5_rtl_support
Commits
81ec6cab
Commit
81ec6cab
authored
May 13, 2011
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using subprocess.PIPE was a bad idea, buildout was so slow.
Use real files instead
parent
ddfe3e8e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
slapos/recipe/erp5.recipe.testnode/setup.py
slapos/recipe/erp5.recipe.testnode/setup.py
+1
-1
slapos/recipe/erp5.recipe.testnode/src/erp5/recipe/testnode/SlapOSControler.py
...cipe.testnode/src/erp5/recipe/testnode/SlapOSControler.py
+13
-5
slapos/recipe/erp5.recipe.testnode/src/erp5/recipe/testnode/testnode.py
...erp5.recipe.testnode/src/erp5/recipe/testnode/testnode.py
+3
-2
No files found.
slapos/recipe/erp5.recipe.testnode/setup.py
View file @
81ec6cab
from
setuptools
import
setup
,
find_packages
from
setuptools
import
setup
,
find_packages
name
=
"erp5.recipe.testnode"
name
=
"erp5.recipe.testnode"
version
=
'1.0.1
3
'
version
=
'1.0.1
6
'
def
read
(
name
):
def
read
(
name
):
return
open
(
name
).
read
()
return
open
(
name
).
read
()
...
...
slapos/recipe/erp5.recipe.testnode/src/erp5/recipe/testnode/SlapOSControler.py
View file @
81ec6cab
...
@@ -5,7 +5,6 @@ class SlapOSControler(object):
...
@@ -5,7 +5,6 @@ class SlapOSControler(object):
def
__init__
(
self
,
config
,
process_group_pid_list
=
None
):
def
__init__
(
self
,
config
,
process_group_pid_list
=
None
):
self
.
config
=
config
self
.
config
=
config
self
.
process_group_pid_list
=
[]
# By erasing everything, we make sure that we are able to "update"
# By erasing everything, we make sure that we are able to "update"
# existing profiles. This is quite dirty way to do updates...
# existing profiles. This is quite dirty way to do updates...
if
os
.
path
.
exists
(
config
[
'proxy_database'
]):
if
os
.
path
.
exists
(
config
[
'proxy_database'
]):
...
@@ -53,17 +52,26 @@ class SlapOSControler(object):
...
@@ -53,17 +52,26 @@ class SlapOSControler(object):
cpu_count
=
os
.
sysconf
(
"SC_NPROCESSORS_ONLN"
)
cpu_count
=
os
.
sysconf
(
"SC_NPROCESSORS_ONLN"
)
os
.
putenv
(
'MAKEFLAGS'
,
'-j%s'
%
cpu_count
)
os
.
putenv
(
'MAKEFLAGS'
,
'-j%s'
%
cpu_count
)
os
.
environ
[
'PATH'
]
=
environment
[
'PATH'
]
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'
,
slapgrid
=
subprocess
.
Popen
([
config
[
'slapgrid_software_binary'
],
'-v'
,
'-c'
,
#'--buildout-parameter',"'-U -N' -o",
#'--buildout-parameter',"'-U -N' -o",
config
[
'slapos_config'
]],
config
[
'slapos_config'
]],
stdout
=
s
ubprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
stdout
=
s
tdout
,
stderr
=
stderr
,
close_fds
=
True
,
preexec_fn
=
os
.
setsid
)
close_fds
=
True
,
preexec_fn
=
os
.
setsid
)
process_group_pid_list
.
append
(
slapgrid
.
pid
)
process_group_pid_list
.
append
(
slapgrid
.
pid
)
slapgrid
.
wait
()
slapgrid
.
wait
()
stdout
,
stderr
=
slapgrid
.
communicate
()
stdout
.
seek
(
0
)
stderr
.
seek
(
0
)
status_dict
=
{
'status_code'
:
slapgrid
.
returncode
,
status_dict
=
{
'status_code'
:
slapgrid
.
returncode
,
'stdout'
:
stdout
,
'stdout'
:
stdout
.
read
(),
'stderr'
:
stderr
}
'stderr'
:
stderr
.
read
()}
stdout
.
close
()
stderr
.
close
()
return
status_dict
return
status_dict
def
runComputerPartition
(
self
,
config
,
process_group_pid_list
=
None
):
def
runComputerPartition
(
self
,
config
,
process_group_pid_list
=
None
):
...
...
slapos/recipe/erp5.recipe.testnode/src/erp5/recipe/testnode/testnode.py
View file @
81ec6cab
...
@@ -109,8 +109,9 @@ repository = %(repository_path)s
...
@@ -109,8 +109,9 @@ repository = %(repository_path)s
updater
=
Updater
(
repository_path
,
git_binary
=
config
[
'git_binary'
])
updater
=
Updater
(
repository_path
,
git_binary
=
config
[
'git_binary'
])
updater
.
checkout
()
updater
.
checkout
()
revision
=
updater
.
getRevision
()
revision
=
updater
.
getRevision
()
if
not
(
retry_software
)
and
previous_revision
==
revision
:
if
previous_revision
==
revision
:
time
.
sleep
(
120
)
time
.
sleep
(
120
)
if
not
(
retry_software
):
continue
continue
retry_software
=
False
retry_software
=
False
previous_revision
=
revision
previous_revision
=
revision
...
...
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