LGTM, thanks

On Wed, Jul 30, 2014 at 6:36 PM, Yuto KAWAMURA(kawamuray) <
[email protected]> wrote:

> Change GetInstanceInfo to use _IsInstanceAlive instead of calling
> lxc-info with the instance name.
> The behavior of lxc-info for nonexistent containers has changed in LXC
> 1.0.0 and it is also not accurate to use lxc-info for checking instance
> existence.
>
> Signed-off-by: Yuto KAWAMURA(kawamuray) <[email protected]>
> ---
>  lib/hypervisor/hv_lxc.py | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/lib/hypervisor/hv_lxc.py b/lib/hypervisor/hv_lxc.py
> index 9a339a6..57d6cfb 100644
> --- a/lib/hypervisor/hv_lxc.py
> +++ b/lib/hypervisor/hv_lxc.py
> @@ -251,15 +251,7 @@ class LXCHypervisor(hv_base.BaseHypervisor):
>      """
>      # TODO: read container info from the cgroup mountpoint
>
> -    result = utils.RunCmd(["lxc-info", "-s", "-n", instance_name])
> -    if result.failed:
> -      raise errors.HypervisorError("Running lxc-info failed: %s" %
> -                                   result.output)
> -    # lxc-info output examples:
> -    # 'state: STOPPED
> -    # 'state: RUNNING
> -    _, state = result.stdout.rsplit(None, 1)
> -    if state != "RUNNING":
> +    if not self._IsInstanceAlive(instance_name):
>        return None
>
>      cpu_list = self._GetCgroupCpuList(instance_name)
> --
> 1.8.5.5
>
>


Hrvoje Ribicic
Ganeti Engineering
Google Germany GmbH
Dienerstr. 12, 80331, München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores
Steuernummer: 48/725/00206
Umsatzsteueridentifikationsnummer: DE813741370

Reply via email to