[PATCH] Fix wrong "Failed to list guest" message

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@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

Reviewed-by: Daniel Barboza <danielhb@linux.vnet.ibm.com> On 02/11/2014 03:39 PM, Rodrigo Trujillo wrote:
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@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

-- Reviewed-by: Paulo Vital <pvital@linux.vnet.ibm.com> On Tue, 2014-02-11 at 15:39 -0200, Rodrigo Trujillo wrote:
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@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

On 02/11/2014 03:39 PM, Rodrigo Trujillo wrote:
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.
Which error? I remembered Royce added im.load() to fix a problem in POWER machines Take a look at: git show 5831b4de
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo@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

On 02/12/2014 09:57 AM, Aline Manera wrote:
On 02/11/2014 03:39 PM, Rodrigo Trujillo wrote:
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.
Which error?
I remembered Royce added im.load() to fix a problem in POWER machines Take a look at: git show 5831b4de
Got explanation from Daniel. Reviewed-by: Aline Manera <alinefm@linux.vnet.ibm.com>
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo@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
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

Applied. Thanks. Regards, Aline Manera
participants (4)
-
Aline Manera
-
Daniel H Barboza
-
Paulo Ricardo Paz Vital
-
Rodrigo Trujillo