LGTM with nitpicks

On Mon, Aug 18, 2014 at 3:38 AM, Yuto KAWAMURA(kawamuray) <
[email protected]> wrote:

> Once I try to modify a hvparam of the LXC hypervisor, I got this error:
>

s/try/tried/


>
>     ValueError: max() arg is an empty sequence
>
> This is because the current default value of cpu_mask hypervisor
>

... the cpu_mask


> parameter for the LXC hypervisor is the zero-length string, so the
>

s/for/of/


> cpu_list which returned by the ParseMultiCpuMask is the blank list.
>

s/which//
... is empty.


> The zero-length string is a valid for the cpu_mask hvparam, so we need
>

a valid value


> to skip this check if the cpu_list is the blank list.
>

is empty.


>
> Signed-off-by: Yuto KAWAMURA(kawamuray) <[email protected]>
> ---
>  lib/cmdlib/instance.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/cmdlib/instance.py b/lib/cmdlib/instance.py
> index 53702c8..870c3c4 100644
> --- a/lib/cmdlib/instance.py
> +++ b/lib/cmdlib/instance.py
> @@ -3438,7 +3438,7 @@ class LUInstanceSetParams(LogicalUnit):
>                                     errors.ECODE_INVAL)
>
>        # Only perform this test if a new CPU mask is given
> -      if constants.HV_CPU_MASK in self.hv_new:
> +      if constants.HV_CPU_MASK in self.hv_new and cpu_list:
>          # Calculate the largest CPU number requested
>          max_requested_cpu = max(map(max, cpu_list))
>          # Check that all of the instance's nodes have enough physical
> CPUs to
> --
> 2.0.4
>
>


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