On Fri, Oct 07, 2016 at 08:37:59PM +0100, 'Viktor Bachraty' via ganeti-devel 
wrote:
> GetInstanceInfo returns info that is already parsed with state being an
> enum value coverted from string using _XenToHypervisorInstanceState()

typo: s/coverted/converted/

> 
> Signed-off-by: Viktor Bachraty <vbachr...@google.com>

Eep. OK. So because of what was effectively a type error, _ShutdownInstance
would usually not detect if an instance was already shut down. LGTM, thanks.

> ---
>  lib/hypervisor/hv_xen.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/hypervisor/hv_xen.py b/lib/hypervisor/hv_xen.py
> index 565854a..7f2c839 100644
> --- a/lib/hypervisor/hv_xen.py
> +++ b/lib/hypervisor/hv_xen.py
> @@ -932,9 +932,9 @@ class XenHypervisor(hv_base.BaseHypervisor):
>                      or None for no timeout
>  
>      """
> -    instance_info = self.GetInstanceInfo(name, hvparams=hvparams)
> +    info = self.GetInstanceInfo(name, hvparams=hvparams)
>  
> -    if instance_info is None or _IsInstanceShutdown(instance_info[4]):
> +    if info is None or hv_base.HvInstanceState.IsShutdown(info[4]):
>        logging.info("Failed to shutdown instance %s, not running", name)
>        return None
>  
> -- 
> 2.8.0.rc3.226.g39d4020
> 

Reply via email to