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
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
Mukul
erp5
Commits
12345392
Commit
12345392
authored
Aug 03, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start to use provided logging.
parent
7c4aa9b8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
22 deletions
+10
-22
erp5/util/testnode/SlapOSControler.py
erp5/util/testnode/SlapOSControler.py
+2
-6
erp5/util/testnode/Updater.py
erp5/util/testnode/Updater.py
+2
-7
erp5/util/testnode/__init__.py
erp5/util/testnode/__init__.py
+4
-4
erp5/util/testnode/testnode.py
erp5/util/testnode/testnode.py
+2
-5
No files found.
erp5/util/testnode/SlapOSControler.py
View file @
12345392
...
...
@@ -32,11 +32,7 @@ import xml_marshaller
class
SlapOSControler
(
object
):
def
log
(
self
,
message
):
print
message
def
__init__
(
self
,
config
,
process_group_pid_set
=
None
,
log
=
None
):
if
log
is
not
None
:
def
__init__
(
self
,
config
,
log
,
process_group_pid_set
=
None
):
self
.
log
=
log
self
.
config
=
config
# By erasing everything, we make sure that we are able to "update"
...
...
erp5/util/testnode/Updater.py
View file @
12345392
...
...
@@ -85,12 +85,7 @@ class Updater(object):
realtime_output
=
True
stdin
=
file
(
os
.
devnull
)
def
log
(
self
,
message
):
print
message
def
__init__
(
self
,
repository_path
,
revision
=
None
,
git_binary
=
None
,
log
=
None
):
if
log
is
not
None
:
def
__init__
(
self
,
repository_path
,
log
,
revision
=
None
,
git_binary
=
None
):
self
.
log
=
log
self
.
revision
=
revision
self
.
_path_list
=
[]
...
...
erp5/util/testnode/__init__.py
View file @
12345392
...
...
@@ -48,9 +48,8 @@ def main(*args):
parsed_argument
=
parser
.
parse_args
(
list
(
args
))
else
:
parsed_argument
=
parser
.
parse_args
()
logger
=
None
if
parsed_argument
.
console
or
parsed_argument
.
logfile
:
logger
=
logging
.
getLogger
(
'erp5testnode'
)
if
parsed_argument
.
console
or
parsed_argument
.
logfile
:
logger
.
setLevel
(
logging
.
INFO
)
if
parsed_argument
.
console
:
logger
.
addHandler
(
logging
.
StreamHandler
())
...
...
@@ -58,7 +57,8 @@ def main(*args):
if
parsed_argument
.
logfile
:
logger
.
addHandler
(
logging
.
FileHandler
(
filename
=
parsed_argument
.
logfile
))
logger
.
info
(
'Activated logfile %r output'
%
parsed_argument
.
logfile
)
if
logger
is
not
None
:
else
:
logger
.
addHandler
(
logging
.
NullHandler
())
CONFIG
[
'logger'
]
=
logger
.
info
config
=
ConfigParser
.
SafeConfigParser
()
# do not change case of option keys
...
...
erp5/util/testnode/testnode.py
View file @
12345392
...
...
@@ -46,10 +46,6 @@ class SubprocessError(EnvironmentError):
from
Updater
import
Updater
def
log
(
message
):
# Log to stdout, with a timestamp.
print
time
.
strftime
(
'%Y/%m/%d %H:%M:%S'
),
message
supervisord_pid_file
=
None
process_group_pid_set
=
set
()
def
sigterm_handler
(
signal
,
frame
):
...
...
@@ -100,6 +96,7 @@ def killPreviousRun():
PROFILE_PATH_KEY
=
'profile_path'
def
run
(
config
):
log
=
config
[
'logger'
]
slapgrid
=
None
global
supervisord_pid_file
supervisord_pid_file
=
os
.
path
.
join
(
config
[
'instance_root'
],
'var'
,
'run'
,
...
...
@@ -225,7 +222,7 @@ branch = %(branch)s
# revision
log
(
' %s at %s'
%
(
repository_path
,
revision
))
updater
=
Updater
(
repository_path
,
git_binary
=
config
[
'git_binary'
],
revision
=
revision
)
revision
=
revision
,
log
=
log
)
updater
.
checkout
()
# Now prepare the installation of SlapOS and create instance
...
...
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