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

[libvirt] [test-API][PATCH] Fix the screenshot case



Fix missing sharemod and nonexist filename

Signed-off-by: Wayne Sun <gsun redhat com>
---
 repos/domain/screenshot.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/repos/domain/screenshot.py b/repos/domain/screenshot.py
index c0db17f..8284fb4 100644
--- a/repos/domain/screenshot.py
+++ b/repos/domain/screenshot.py
@@ -6,6 +6,7 @@ import os
 import mimetypes
 
 import libvirt
+from src import sharedmod
 
 required_params = ('guestname', 'filename',)
 optional_params = {'screen' : 0}
@@ -30,9 +31,9 @@ def screenshot(params):
 
     ext = mimetypes.guess_extension(mime) or '.ppm'
     last_filename = params['filename'] + ext
-    f = file(filename, 'w')
+    f = file(last_filename, 'w')
 
-    logger.debug('Saving screenshot into %s' % filename)
+    logger.debug('Saving screenshot into %s' % last_filename)
     st.recvAll(saver, f)
     logger.debug('Mimetype of the file is %s' % mime)
 
-- 
1.7.1


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