LGTM, thanks!

Nitpicks to follow.

On Thu, Jul 24, 2014 at 2:31 AM, Yuto KAWAMURA(kawamuray) <
[email protected]> wrote:

> Change GetInstanceInfo to use _IsInstanceAlive instead of calling
> lxc-info for instance name.
>

s/for/with the/


> Behavior of lxc-info for not existing container is changed in LXC 1.0.0
>

The behavior ...
s/not existing/nonexistent/
s/container is/containers has/


> and also it is not accurate to use lxc-info for instance existence.
>

s/also it is/it is also/
... for checking ...


>
> 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 9729f3f..4d358c0 100644
> --- a/lib/hypervisor/hv_lxc.py
> +++ b/lib/hypervisor/hv_lxc.py
> @@ -253,15 +253,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