[Kimchi-devel] [PATCH] Fix wrong "Failed to list guest" message

Rodrigo Trujillo rodrigo.trujillo at linux.vnet.ibm.com
Tue Feb 11 17:39:18 UTC 2014


The module vmscreenshot is preventing this error using Image.load
function inside a try/except. However right after the except block,
the code calls Image.thumbnail() function, which calls the same
load() function internally. Then the error could happen again.
This patch fixes this possible problem.

Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
---
 src/kimchi/screenshot.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/kimchi/screenshot.py b/src/kimchi/screenshot.py
index 5cfea96..91c14a6 100644
--- a/src/kimchi/screenshot.py
+++ b/src/kimchi/screenshot.py
@@ -177,10 +177,9 @@ class VMScreenshot(object):
             try:
                 # Prevent Image lib from lazy load,
                 # work around pic truncate validation in thumbnail generation
-                im.load()
+                im.thumbnail(self.THUMBNAIL_SIZE)
             except Exception as e:
                 kimchi_log.warning("Image load with warning: %s." % e)
-            im.thumbnail(self.THUMBNAIL_SIZE)
             im.save(thumbnail, "PNG")
 
         self.info['thumbnail'] = thumbnail
-- 
1.8.5.3




More information about the Kimchi-devel mailing list