[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH v2] domain:screenshot: fixed screen parameter



The screen parameter must be an integer.
I also chnaged it to variable parameter with the reasonable default.
---
v2:
 - fixed "'screen'" to "screen" (stupid typo)

 repos/domain/screenshot.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/repos/domain/screenshot.py b/repos/domain/screenshot.py
index d73e980..3c0f85b 100644
--- a/repos/domain/screenshot.py
+++ b/repos/domain/screenshot.py
@@ -7,8 +7,8 @@ import mimetypes

 import libvirt

-required_params = ('guestname', 'screen', 'filename',)
-optional_params = ()
+required_params = ('guestname', 'filename',)
+optional_params = ('screen',)

 def saver(stream, data, file_):
     return file_.write(data)
@@ -24,7 +24,8 @@ def screenshot(params):
         dom = conn.lookupByName(params['guestname'])

         st = conn.newStream(0)
-        mime = dom.screenshot(st, params['screen'], 0)
+        screen = params.get('screen', 0)
+        mime = dom.screenshot(st, int(screen), 0)

         ext = mimetypes.guess_extension(mime) or '.ppm'
         filename = params['filename'] + ext
--
1.7.8.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]