On Tue, Feb 04, 2014 at 05:00:31PM +0100, Santi Raffa wrote:
> Signed-off-by: Santi Raffa <[email protected]>
> ---
>  lib/cmdlib/instance_operation.py |  7 +++++--
>  man/gnt-instance.rst             |  5 ++++-
>  src/Ganeti/OpCodes.hs            |  2 ++
>  src/Ganeti/OpParams.hs           | 22 ++++++++++++++++++++++
>  test/hs/Test/Ganeti/OpCodes.hs   |  1 +
>  5 files changed, 34 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/cmdlib/instance_operation.py 
> b/lib/cmdlib/instance_operation.py
> index 0f3599b..a69e021 100644
> --- a/lib/cmdlib/instance_operation.py
> +++ b/lib/cmdlib/instance_operation.py
> @@ -302,8 +302,11 @@ class LUInstanceReinstall(LogicalUnit):
>  
>      node_uuids = list(instance.all_nodes)
>  
> -    if self.op.osparams:
> -      i_osdict = GetUpdatedParams(instance.osparams, self.op.osparams)
> +    if self.op.osparams or self.op.osparams_private or 
> self.op.osparams_secret:
> +      i_osdict = GetUpdatedParams(instance.osparams,
> +                                  self.op.osparams,
> +                                  self.op.osparams_private,
> +                                  self.op.osparams_secret)

I can't find the definition of 'GetUpdatedParams' that takes all of
these args.  Where is it?

>        CheckOSParams(self, True, node_uuids, instance_os, i_osdict)
>        self.os_inst = i_osdict # the new dict (without defaults)
>      else:
> diff --git a/man/gnt-instance.rst b/man/gnt-instance.rst
> index f41cfd7..4e760ec 100644
> --- a/man/gnt-instance.rst
> +++ b/man/gnt-instance.rst
> @@ -1292,7 +1292,10 @@ REINSTALL
>  | **reinstall** [{-o|\--os-type} *os-type*] [\--select-os] [-f *force*]
>  | [\--force-multiple]
>  | [\--instance \| \--node \| \--primary \| \--secondary \| \--all]
> -| [{-O|\--os-parameters} *OS\_PARAMETERS*] [\--submit] [\--print-job-id]
> +| [{-O|\--os-parameters} *OS\_PARAMETERS*]
> +| [--os-parameters-private} *OS\_PARAMETERS*]
> +| [--os-parameters-secret} *OS\_PARAMETERS*]
> +| [\--submit] [\--print-job-id]
>  | {*instance*...}
>  
>  Reinstalls the operating system on the given instance(s). The
> diff --git a/src/Ganeti/OpCodes.hs b/src/Ganeti/OpCodes.hs
> index 362b2e8..b257ce4 100644
> --- a/src/Ganeti/OpCodes.hs
> +++ b/src/Ganeti/OpCodes.hs
> @@ -473,6 +473,8 @@ $(genOpCode "OpCode"
>       , pForceVariant
>       , pInstOs
>       , pTempOsParams
> +     , pTempOsParamsPrivate
> +     , pTempOsParamsSecret
>       ],
>       "instance_name")
>    , ("OpInstanceRemove",
> diff --git a/src/Ganeti/OpParams.hs b/src/Ganeti/OpParams.hs
> index 9dcb5e6..997646f 100644
> --- a/src/Ganeti/OpParams.hs
> +++ b/src/Ganeti/OpParams.hs
> @@ -189,6 +189,8 @@ module Ganeti.OpParams
>    , pInstTags
>    , pMultiAllocInstances
>    , pTempOsParams
> +  , pTempOsParamsPrivate
> +  , pTempOsParamsSecret
>    , pTempHvParams
>    , pTempBeParams
>    , pIgnoreFailures
> @@ -1216,6 +1218,26 @@ pTempOsParams =
>    renameField "TempOsParams" .
>    optionalField $ simpleField "osparams" [t| JSObject JSValue |]
>  
> +pTempOsParamsPrivate :: Field
> +pTempOsParamsPrivate =
> +  field { fieldDoc = "meh"
> +          -- fieldShow = Just [| \(_,y) -> showPrivateJSObject y |]
> +        }

This is of course to be removed :)

> +  where field =
> +          withDoc "Private OS parameters for instance reinstalls" .
> +          optionalField $
> +          simpleField "osparams_private" [t| JSObject (Private JSValue) |]
> +
> +pTempOsParamsSecret :: Field
> +pTempOsParamsSecret =
> +  field { fieldDoc = "meh"
> +          -- fieldShow = Just [| \(_,y) -> showPrivateJSObject y |]
> +        }

This is of course to be removed :)

Thanks,
Jose

> +  where field =
> +          withDoc "Secret OS parameters for instance reinstalls" .
> +          optionalField $
> +          simpleField "osparams_secret" [t| JSObject (Private JSValue) |]
> +
>  pShutdownTimeout :: Field
>  pShutdownTimeout =
>    withDoc "How long to wait for instance to shut down" .
> diff --git a/test/hs/Test/Ganeti/OpCodes.hs b/test/hs/Test/Ganeti/OpCodes.hs
> index 56a76fc..429e379 100644
> --- a/test/hs/Test/Ganeti/OpCodes.hs
> +++ b/test/hs/Test/Ganeti/OpCodes.hs
> @@ -300,6 +300,7 @@ instance Arbitrary OpCodes.OpCode where
>        "OP_INSTANCE_REINSTALL" ->
>          OpCodes.OpInstanceReinstall <$> genFQDN <*> return Nothing <*>
>            arbitrary <*> genMaybe genNameNE <*> genMaybe (pure emptyJSObject)
> +          <*> genMaybe arbitraryPrivateJSObj <*> genMaybe 
> arbitraryPrivateJSObj
>        "OP_INSTANCE_REMOVE" ->
>          OpCodes.OpInstanceRemove <$> genFQDN <*> return Nothing <*>
>            arbitrary <*> arbitrary
> -- 
> 1.9.0.rc1.175.g0b1dcb5
> 

-- 
Jose Antonio Lopes
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