Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
vmdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9213ffa0
authored
Nov 11, 2013
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vmdriver: fixing minor issues
parent
901b77cf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
vmdriver.py
+2
-4
No files found.
vmdriver.py
View file @
9213ffa0
...
@@ -21,7 +21,7 @@ state_dict = {0: 'NOSTATE',
...
@@ -21,7 +21,7 @@ state_dict = {0: 'NOSTATE',
}
}
#class Singleton(type):
#
class Singleton(type):
#
#
# """ Singleton class."""
# """ Singleton class."""
#
#
...
@@ -97,7 +97,6 @@ def wrap_libvirtError(original_function, *args, **kw):
...
@@ -97,7 +97,6 @@ def wrap_libvirtError(original_function, *args, **kw):
raise
new_e
raise
new_e
@celery.task
@wrap_libvirtError
@wrap_libvirtError
def
connect
(
connection_string
=
'qemu:///system'
):
def
connect
(
connection_string
=
'qemu:///system'
):
""" Connect to the libvirt daemon.
""" Connect to the libvirt daemon.
...
@@ -117,7 +116,6 @@ def connect(connection_string='qemu:///system'):
...
@@ -117,7 +116,6 @@ def connect(connection_string='qemu:///system'):
logging
.
debug
(
"Using celery libvirt connection connection."
)
logging
.
debug
(
"Using celery libvirt connection connection."
)
@celery.task
@wrap_libvirtError
@wrap_libvirtError
def
disconnect
():
def
disconnect
():
""" Disconnect from the active libvirt daemon connection."""
""" Disconnect from the active libvirt daemon connection."""
...
@@ -449,7 +447,7 @@ def screenshot(name, path):
...
@@ -449,7 +447,7 @@ def screenshot(name, path):
stream
=
Connection
.
get
()
.
newStream
(
0
)
stream
=
Connection
.
get
()
.
newStream
(
0
)
# Take screenshot accessible by stream (return mimetype)
# Take screenshot accessible by stream (return mimetype)
domain
.
screenshot
(
stream
,
0
,
0
)
domain
.
screenshot
(
stream
,
0
,
0
)
# Get file to save data (
TODO:
send on AMQP?)
# Get file to save data (send on AMQP?)
try
:
try
:
fd
=
os
.
open
(
path
+
"/"
+
name
+
"-screenshot.ppm"
,
fd
=
os
.
open
(
path
+
"/"
+
name
+
"-screenshot.ppm"
,
os
.
O_WRONLY
|
os
.
O_TRUNC
|
os
.
O_CREAT
,
0
o644
)
os
.
O_WRONLY
|
os
.
O_TRUNC
|
os
.
O_CREAT
,
0
o644
)
...
...
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