The screen parameter must be an integer. I also chnaged it to variable parameter with the reasonable default. --- 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..3e727a7 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 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list