Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
snf-ganeti
Commits
b48909c8
Commit
b48909c8
authored
Oct 20, 2008
by
Iustin Pop
Browse files
Convert hv_xen.py to use the logging module
Reviewed-by: imsnah
parent
a5eb7789
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/hypervisor/hv_xen.py
View file @
b48909c8
...
...
@@ -26,11 +26,11 @@
import
os
import
os.path
import
time
import
logging
from
cStringIO
import
StringIO
from
ganeti
import
constants
from
ganeti
import
errors
from
ganeti
import
logger
from
ganeti
import
utils
from
ganeti.hypervisor
import
hv_base
...
...
@@ -71,8 +71,8 @@ class XenHypervisor(hv_base.BaseHypervisor):
result
=
utils
.
RunCmd
([
"xm"
,
"list"
])
if
not
result
.
failed
:
break
logg
er
.
E
rror
(
"xm list failed (%s): %s"
%
(
result
.
fail_reason
,
result
.
output
)
)
logg
ing
.
e
rror
(
"xm list failed (%s): %s"
,
result
.
fail_reason
,
result
.
output
)
time
.
sleep
(
1
)
if
result
.
failed
:
...
...
@@ -184,7 +184,8 @@ class XenHypervisor(hv_base.BaseHypervisor):
# note: in xen 3, memory has changed to total_memory
result
=
utils
.
RunCmd
([
"xm"
,
"info"
])
if
result
.
failed
:
logger
.
Error
(
"Can't run 'xm info': %s"
%
result
.
fail_reason
)
logging
.
error
(
"Can't run 'xm info' (%s): %s"
,
result
.
fail_reason
,
result
.
output
)
return
None
xmoutput
=
result
.
stdout
.
splitlines
()
...
...
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