Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Commits
bdd79ceb
Commit
bdd79ceb
authored
Jun 29, 2011
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use timestamped logger in Updater & SlapOSControler.
parent
e0ec5401
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
7 deletions
+19
-7
slapos/recipe/erp5testnode/SlapOSControler.py
slapos/recipe/erp5testnode/SlapOSControler.py
+8
-3
slapos/recipe/erp5testnode/Updater.py
slapos/recipe/erp5testnode/Updater.py
+8
-2
slapos/recipe/erp5testnode/testnode.py
slapos/recipe/erp5testnode/testnode.py
+3
-2
No files found.
slapos/recipe/erp5testnode/SlapOSControler.py
View file @
bdd79ceb
...
...
@@ -3,7 +3,12 @@ from xml_marshaller import xml_marshaller
class
SlapOSControler
(
object
):
def
__init__
(
self
,
config
,
process_group_pid_set
=
None
):
def
log
(
self
,
message
):
print
message
def
__init__
(
self
,
config
,
process_group_pid_set
=
None
,
log
=
None
):
if
log
is
not
None
:
self
.
log
=
log
self
.
config
=
config
# By erasing everything, we make sure that we are able to "update"
# existing profiles. This is quite dirty way to do updates...
...
...
@@ -48,7 +53,7 @@ class SlapOSControler(object):
def
runSoftwareRelease
(
self
,
config
,
environment
,
process_group_pid_set
=
None
,
stdout
=
None
,
stderr
=
None
):
print
"SlapOSControler.runSoftwareRelease"
self
.
log
(
"SlapOSControler.runSoftwareRelease"
)
cpu_count
=
os
.
sysconf
(
"SC_NPROCESSORS_ONLN"
)
os
.
putenv
(
'MAKEFLAGS'
,
'-j%s'
%
cpu_count
)
os
.
environ
[
'PATH'
]
=
environment
[
'PATH'
]
...
...
@@ -72,7 +77,7 @@ class SlapOSControler(object):
def
runComputerPartition
(
self
,
config
,
environment
,
process_group_pid_set
=
None
,
stdout
=
None
,
stderr
=
None
):
print
"SlapOSControler.runComputerPartition"
self
.
log
(
"SlapOSControler.runComputerPartition"
)
slap
=
slapos
.
slap
.
slap
()
slap
.
registerOpenOrder
().
request
(
self
.
software_profile
,
partition_reference
=
'testing partition'
,
...
...
slapos/recipe/erp5testnode/Updater.py
View file @
bdd79ceb
...
...
@@ -53,7 +53,13 @@ class Updater(object):
realtime_output
=
True
stdin
=
file
(
os
.
devnull
)
def
__init__
(
self
,
repository_path
,
revision
=
None
,
git_binary
=
None
):
def
log
(
self
,
message
):
print
message
def
__init__
(
self
,
repository_path
,
revision
=
None
,
git_binary
=
None
,
log
=
None
):
if
log
is
not
None
:
self
.
log
=
log
self
.
revision
=
revision
self
.
_path_list
=
[]
self
.
repository_path
=
repository_path
...
...
@@ -94,7 +100,7 @@ class Updater(object):
quiet
=
kw
.
pop
(
'quiet'
,
False
)
env
=
kw
and
dict
(
os
.
environ
,
**
kw
)
or
None
command
=
format_command
(
*
args
,
**
kw
)
print
'
\
n
$ '
+
command
self
.
log
(
'
\
n
$ '
+
command
)
sys
.
stdout
.
flush
()
p
=
subprocess
.
Popen
(
args
,
stdin
=
self
.
stdin
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
env
=
env
,
...
...
slapos/recipe/erp5testnode/testnode.py
View file @
bdd79ceb
...
...
@@ -169,7 +169,8 @@ branch = %(branch)s
parameter_list
.
append
(
repository_path
)
subprocess
.
check_call
(
parameter_list
)
# Make sure we have local repository
updater
=
Updater
(
repository_path
,
git_binary
=
config
[
'git_binary'
])
updater
=
Updater
(
repository_path
,
git_binary
=
config
[
'git_binary'
],
log
=
log
)
updater
.
checkout
()
revision
=
"-"
.
join
(
updater
.
getRevision
())
full_revision_list
.
append
(
'%s=%s'
%
(
repository_id
,
revision
))
...
...
@@ -212,7 +213,7 @@ branch = %(branch)s
# Now prepare the installation of SlapOS and create instance
slapos_controler
=
SlapOSControler
(
config
,
process_group_pid_set
=
process_group_pid_set
)
process_group_pid_set
=
process_group_pid_set
,
log
=
log
)
for
method_name
in
(
"runSoftwareRelease"
,
"runComputerPartition"
):
stdout
,
stderr
=
getInputOutputFileList
(
config
,
method_name
)
slapos_method
=
getattr
(
slapos_controler
,
method_name
)
...
...
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