Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Léo-Paul Géneau
slapos.core
Commits
36518458
Commit
36518458
authored
Apr 29, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed duplicate logging
parent
1e726abc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
19 deletions
+17
-19
slapos/cli/slapgrid.py
slapos/cli/slapgrid.py
+3
-10
slapos/cli_legacy/entry.py
slapos/cli_legacy/entry.py
+3
-3
slapos/cli_legacy/svcbackend.py
slapos/cli_legacy/svcbackend.py
+10
-5
slapos/slap/slap.py
slapos/slap/slap.py
+1
-1
No files found.
slapos/cli/slapgrid.py
View file @
36518458
...
@@ -16,6 +16,9 @@ class SlapgridCommand(ConfigCommand):
...
@@ -16,6 +16,9 @@ class SlapgridCommand(ConfigCommand):
method_name
=
NotImplemented
method_name
=
NotImplemented
default_pidfile
=
NotImplemented
default_pidfile
=
NotImplemented
CONSOLE_MESSAGE_FORMAT
=
'%(message)s'
LOG_FILE_MESSAGE_FORMAT
=
'[%(asctime)s] %(levelname)-8s %(name)s %(message)s'
def
get_parser
(
self
,
prog_name
):
def
get_parser
(
self
,
prog_name
):
ap
=
super
(
SlapgridCommand
,
self
).
get_parser
(
prog_name
)
ap
=
super
(
SlapgridCommand
,
self
).
get_parser
(
prog_name
)
...
@@ -64,23 +67,13 @@ class SlapgridCommand(ConfigCommand):
...
@@ -64,23 +67,13 @@ class SlapgridCommand(ConfigCommand):
'this option will make all others computer partitions be ignored.'
)
'this option will make all others computer partitions be ignored.'
)
return
ap
return
ap
def
take_action
(
self
,
args
):
def
take_action
(
self
,
args
):
config
=
self
.
fetch_config
(
args
)
config
=
self
.
fetch_config
(
args
)
options
=
merged_options
(
args
,
config
)
options
=
merged_options
(
args
,
config
)
# XXX add formatter
# formatter = logging.Formatter(fmt='%(asctime)s %(name)-18s: '
# '%(levelname)-8s %(message)s',
# datefmt='%Y-%m-%dT%H:%M:%S')
#
# handler.setFormatter(formatter)
check_missing_parameters
(
options
)
check_missing_parameters
(
options
)
check_missing_files
(
options
)
check_missing_files
(
options
)
# XXX this action is logging twice
random_delay
(
options
,
logger
=
self
.
log
)
random_delay
(
options
,
logger
=
self
.
log
)
slapgrid_object
=
create_slapgrid_object
(
options
,
logger
=
self
.
log
)
slapgrid_object
=
create_slapgrid_object
(
options
,
logger
=
self
.
log
)
...
...
slapos/cli_legacy/entry.py
View file @
36518458
...
@@ -38,9 +38,9 @@ from slapos.cli_legacy.remove import remove
...
@@ -38,9 +38,9 @@ from slapos.cli_legacy.remove import remove
from
slapos.cli_legacy.supply
import
supply
from
slapos.cli_legacy.supply
import
supply
from
slapos.cli_legacy.format
import
main
as
format
from
slapos.cli_legacy.format
import
main
as
format
from
slapos.cli_legacy.cache
import
cache_lookup
from
slapos.cli_legacy.cache
import
cache_lookup
from
slapos.
grid
.slapgrid
import
runComputerPartition
as
instance
from
slapos.
cli_legacy
.slapgrid
import
runComputerPartition
as
instance
from
slapos.
grid
.slapgrid
import
runSoftwareRelease
as
software
from
slapos.
cli_legacy
.slapgrid
import
runSoftwareRelease
as
software
from
slapos.
grid
.slapgrid
import
runUsageReport
as
report
from
slapos.
cli_legacy
.slapgrid
import
runUsageReport
as
report
from
slapos.cli_legacy.svcbackend
import
supervisord
from
slapos.cli_legacy.svcbackend
import
supervisord
from
slapos.cli_legacy.svcbackend
import
supervisorctl
from
slapos.cli_legacy.svcbackend
import
supervisorctl
from
slapos.cli_legacy.register
import
main
as
register
from
slapos.cli_legacy.register
import
main
as
register
...
...
slapos/cli_legacy/svcbackend.py
View file @
36518458
...
@@ -35,11 +35,6 @@ import ConfigParser
...
@@ -35,11 +35,6 @@ import ConfigParser
from
slapos.grid.svcbackend
import
launchSupervisord
from
slapos.grid.svcbackend
import
launchSupervisord
logger
=
logging
.
getLogger
(
'SVCBackend'
)
logger
.
setLevel
(
logging
.
INFO
)
handler
=
logging
.
StreamHandler
()
logger
.
addHandler
(
handler
)
def
getOptionDict
(
*
argument_tuple
):
def
getOptionDict
(
*
argument_tuple
):
usage
=
"""
usage
=
"""
...
@@ -78,6 +73,11 @@ Typical usage:
...
@@ -78,6 +73,11 @@ Typical usage:
def
supervisorctl
(
*
argument_tuple
):
def
supervisorctl
(
*
argument_tuple
):
logger
=
logging
.
getLogger
(
'SVCBackend'
)
logger
.
setLevel
(
logging
.
INFO
)
handler
=
logging
.
StreamHandler
()
logger
.
addHandler
(
handler
)
option_dict
,
args
=
getOptionDict
(
*
argument_tuple
)
option_dict
,
args
=
getOptionDict
(
*
argument_tuple
)
import
supervisor.supervisorctl
import
supervisor.supervisorctl
launchSupervisord
(
socket
=
option_dict
[
'supervisord_socket'
],
launchSupervisord
(
socket
=
option_dict
[
'supervisord_socket'
],
...
@@ -87,6 +87,11 @@ def supervisorctl(*argument_tuple):
...
@@ -87,6 +87,11 @@ def supervisorctl(*argument_tuple):
def
supervisord
(
*
argument_tuple
):
def
supervisord
(
*
argument_tuple
):
logger
=
logging
.
getLogger
(
'SVCBackend'
)
logger
.
setLevel
(
logging
.
INFO
)
handler
=
logging
.
StreamHandler
()
logger
.
addHandler
(
handler
)
option_dict
,
_
=
getOptionDict
(
*
argument_tuple
)
option_dict
,
_
=
getOptionDict
(
*
argument_tuple
)
launchSupervisord
(
socket
=
option_dict
[
'supervisord_socket'
],
launchSupervisord
(
socket
=
option_dict
[
'supervisord_socket'
],
configuration_file
=
option_dict
[
'supervisord_configuration_path'
],
configuration_file
=
option_dict
[
'supervisord_configuration_path'
],
...
...
slapos/slap/slap.py
View file @
36518458
...
@@ -46,7 +46,7 @@ import zope.interface
...
@@ -46,7 +46,7 @@ import zope.interface
from
interface
import
slap
as
interface
from
interface
import
slap
as
interface
from
xml_marshaller
import
xml_marshaller
from
xml_marshaller
import
xml_marshaller
fallback_logger
=
logging
.
getLogger
()
fallback_logger
=
logging
.
getLogger
(
__name__
)
fallback_handler
=
logging
.
StreamHandler
()
fallback_handler
=
logging
.
StreamHandler
()
fallback_logger
.
setLevel
(
logging
.
INFO
)
fallback_logger
.
setLevel
(
logging
.
INFO
)
fallback_logger
.
addHandler
(
fallback_handler
)
fallback_logger
.
addHandler
(
fallback_handler
)
...
...
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