Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
vmdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3a347f2c
authored
Sep 25, 2013
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing wrapper and add logging
parent
2543f1aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
vmdriver.py
+4
-6
No files found.
vmdriver.py
View file @
3a347f2c
...
...
@@ -49,8 +49,9 @@ def req_connection(original_function, *args, **kw):
@decorator
def
wrap_libvirtError
(
original_function
,
*
args
,
**
kw
):
try
:
original_function
(
*
args
,
**
kw
)
return
original_function
(
*
args
,
**
kw
)
except
libvirt
.
libvirtError
as
e
:
logging
.
error
(
e
.
get_error_message
())
new_e
=
Exception
(
e
.
get_error_message
())
new_e
.
libvirtError
=
True
raise
new_e
...
...
@@ -120,7 +121,7 @@ def create(vm_desc):
if
vm
.
vm_type
==
"test"
:
connection
.
createXML
(
vm
.
dump_xml
(),
libvirt
.
VIR_DOMAIN_NONE
)
domain
=
connection
.
lookupByName
(
vm
.
name
)
domain
=
lookupByName
(
vm
.
name
)
domain
.
suspend
()
# Real driver create
else
:
...
...
@@ -169,10 +170,7 @@ def list_domains():
def
lookupByName
(
name
):
'''Return with the requested Domain
'''
try
:
return
connection
.
lookupByName
(
name
)
except
libvirt
.
libvirtError
as
e
:
logging
.
error
(
e
.
get_error_message
())
return
connection
.
lookupByName
(
name
)
@celery.task
...
...
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