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

Paulo Ricardo Paz Vital pvital at linux.vnet.ibm.com
Wed Feb 12 11:55:34 UTC 2014


-- 
Reviewed-by: Paulo Vital <pvital at 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 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




More information about the Kimchi-devel mailing list