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
Klaus Wölfel
slapos.core
Commits
7184077e
Commit
7184077e
authored
Feb 08, 2013
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use global logger.
Fix Interface serializing that was trying to serialize logger as well.
parent
fa152753
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
slapos/format.py
slapos/format.py
+9
-7
No files found.
slapos/format.py
View file @
7184077e
...
...
@@ -54,6 +54,11 @@ import lxml.etree
from
slapos.version
import
version
# set up logging
logger
=
logging
.
getLogger
(
"slapformat"
)
logger
.
setLevel
(
logging
.
INFO
)
def
prettify_xml
(
xml
):
root
=
lxml
.
etree
.
fromstring
(
xml
)
return
lxml
.
etree
.
tostring
(
root
,
pretty_print
=
True
)
...
...
@@ -664,9 +669,6 @@ class Interface(object):
_
,
result
=
callAndRead
([
'ip'
,
'addr'
,
'list'
,
self
.
name
])
self
.
attach_to_tap
=
'DOWN'
in
result
.
split
(
'
\
n
'
,
1
)[
0
]
# XXX-Cedric should be global logger
self
.
logger
=
logging
.
getLogger
(
"slapformat"
)
def
__getinitargs__
(
self
):
return
(
self
.
name
,)
...
...
@@ -817,7 +819,7 @@ class Interface(object):
if
self
.
_addSystemAddress
(
addr
,
netmask
,
False
):
return
dict
(
addr
=
addr
,
netmask
=
netmask
)
else
:
self
.
logger
.
warning
(
'Impossible to add old local IPv4 %s. Generating '
logger
.
warning
(
'Impossible to add old local IPv4 %s. Generating '
'new IPv4 address.'
%
addr
)
return
self
.
_generateRandomIPv4Address
(
netmask
)
else
:
...
...
@@ -875,7 +877,7 @@ class Interface(object):
# succeed, return it
return
dict
(
addr
=
addr
,
netmask
=
netmask
)
else
:
self
.
logger
.
warning
(
'Impossible to add old public IPv6 %s. '
logger
.
warning
(
'Impossible to add old public IPv6 %s. '
'Generating new IPv6 address.'
%
addr
)
# Try 10 times to add address, raise in case if not possible
...
...
@@ -1151,8 +1153,8 @@ class Config(object):
self
.
cert_file
=
None
# set up logging
self
.
logger
=
logging
.
getLogger
(
"slapformat"
)
self
.
logger
.
setLevel
(
logging
.
INFO
)
# XXX-Cedric: change code to use global logger
self
.
logger
=
logger
# Set options parameters
for
option
,
value
in
option_dict
.
__dict__
.
items
():
...
...
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