LGTM, thanks

On Mon, Feb 10, 2014 at 10:18 AM, Jose A. Lopes <[email protected]>wrote:

> Move OS parameter related constants to 'ganeti.cli' so they are used
> both by instance create and instance import from the CLI.
>
> Signed-off-by: Jose A. Lopes <[email protected]>
> ---
>  lib/cli.py                 | 8 +++++---
>  lib/client/gnt_instance.py | 2 +-
>  2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/lib/cli.py b/lib/cli.py
> index e9bf963..a92233c 100644
> --- a/lib/cli.py
> +++ b/lib/cli.py
> @@ -1751,6 +1751,8 @@ COMMON_CREATE_OPTS = [
>    NONICS_OPT,
>    NWSYNC_OPT,
>    OSPARAMS_OPT,
> +  OSPARAMS_PRIVATE_OPT,
> +  OSPARAMS_SECRET_OPT,
>    OS_SIZE_OPT,
>    SUBMIT_OPT,
>    PRINT_JOBID_OPT,
> @@ -2755,6 +2757,9 @@ def GenericInstanceCreate(mode, opts, args):
>    utils.ForceDictType(hvparams, constants.HVS_PARAMETER_TYPES)
>    FixHvParams(hvparams)
>
> +  osparams_private = opts.osparams_private or serializer.PrivateDict()
> +  osparams_secret = opts.osparams_secret or serializer.PrivateDict()
> +
>    if mode == constants.INSTANCE_CREATE:
>      start = opts.start
>      os_type = opts.os
> @@ -2778,9 +2783,6 @@ def GenericInstanceCreate(mode, opts, args):
>    else:
>      raise errors.ProgrammerError("Invalid creation mode %s" % mode)
>
> -  osparams_private = opts.osparams_private or serializer.PrivateDict()
> -  osparams_secret = opts.osparams_private or serializer.PrivateDict()
> -
>    op = opcodes.OpInstanceCreate(instance_name=instance,
>                                  disks=disks,
>                                  disk_template=opts.disk_template,
> diff --git a/lib/client/gnt_instance.py b/lib/client/gnt_instance.py
> index 4ef8e9a..1e3a573 100644
> --- a/lib/client/gnt_instance.py
> +++ b/lib/client/gnt_instance.py
> @@ -1488,7 +1488,7 @@ add_opts = [
>  commands = {
>    "add": (
>      AddInstance, [ArgHost(min=1, max=1)],
> -    COMMON_CREATE_OPTS + add_opts + [OSPARAMS_PRIVATE_OPT,
> OSPARAMS_SECRET_OPT],
> +    COMMON_CREATE_OPTS + add_opts,
>      "[...] -t disk-type -n node[:secondary-node] -o os-type <name>",
>      "Creates and adds a new instance to the cluster"),
>    "batch-create": (
> --
> 1.9.0.rc1.175.g0b1dcb5
>
>


-- 
-- 
Helga Velroyen | Software Engineer | [email protected] |

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