On Tue, Dec 10, 2013 at 10:14 AM, Dimitris Aragiorgis <[email protected]> wrote:
> If param=default and the param already exists then we remove
> it from params dict. This is stolen by GetUpdatedParams() which
> is used for hvparams modification/inheritance.
>
> This means that 'default' value is unaccepted for an arbitrary
> param of an ext disk.

s/unaccepted/not accepted/

I'll change it myself while pushing.

>
> Signed-off-by: Dimitris Aragiorgis <[email protected]>
> ---
>  lib/cmdlib/instance.py |    9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/lib/cmdlib/instance.py b/lib/cmdlib/instance.py
> index e01dd13..33461d9 100644
> --- a/lib/cmdlib/instance.py
> +++ b/lib/cmdlib/instance.py
> @@ -3194,7 +3194,14 @@ class LUInstanceSetParams(LogicalUnit):
>      for key, value in params.iteritems():
>        if (key not in [constants.IDISK_MODE, constants.IDISK_NAME] and
>            self.instance.disk_template == constants.DT_EXT):
> -        disk.params[key] = value
> +        # stolen from GetUpdatedParams: default means reset/delete
> +        if value.lower() == constants.VALUE_DEFAULT:
> +          try:
> +            del disk.params[key]
> +          except KeyError:
> +            pass
> +        else:
> +          disk.params[key] = value
>          changes.append(("disk.params:%s/%d" % (key, idx), value))
>
>      return changes
> --
> 1.7.10.4
>

LGTM, thanks.

-- 
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

Reply via email to