Isn't the FIXME invalid after your change and should be rewritten?

LGTM otherwise.

On Fri, Nov 8, 2013 at 5:24 PM, Jose A. Lopes <[email protected]> wrote:

> Add instance state 'USER_down' which is a state used in reporting only
> and it represents the situation in which the user has shutdown the
> instance but Ganeti's configuration still has this instance marked as
> 'ADMIN_up'.
>
> Signed-off-by: Jose A. Lopes <[email protected]>
> ---
>  lib/constants.py          | 1 +
>  src/Ganeti/HsConstants.hs | 3 +++
>  src/Ganeti/Types.hs       | 7 +++++--
>  3 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/lib/constants.py b/lib/constants.py
> index 4ea849a..61eed72 100644
> --- a/lib/constants.py
> +++ b/lib/constants.py
> @@ -989,6 +989,7 @@ INSTST_NODEDOWN = _constants.INSTST_NODEDOWN
>  INSTST_WRONGNODE = _constants.INSTST_WRONGNODE
>  INSTST_ERRORUP = _constants.INSTST_ERRORUP
>  INSTST_ERRORDOWN = _constants.INSTST_ERRORDOWN
> +INSTST_USERDOWN = _constants.INSTST_USERDOWN
>  INSTST_ALL = _constants.INSTST_ALL
>
>  ADMINST_UP = _constants.ADMINST_UP
> diff --git a/src/Ganeti/HsConstants.hs b/src/Ganeti/HsConstants.hs
> index e0185cc..c714f50 100644
> --- a/src/Ganeti/HsConstants.hs
> +++ b/src/Ganeti/HsConstants.hs
> @@ -3033,6 +3033,9 @@ inststNodeoffline = Types.instanceStatusToRaw
> NodeOffline
>  inststRunning :: String
>  inststRunning = Types.instanceStatusToRaw Running
>
> +inststUserdown :: String
> +inststUserdown = Types.instanceStatusToRaw UserDown
> +
>  inststWrongnode :: String
>  inststWrongnode = Types.instanceStatusToRaw WrongNode
>
> diff --git a/src/Ganeti/Types.hs b/src/Ganeti/Types.hs
> index 63124fd..7cef96c 100644
> --- a/src/Ganeti/Types.hs
> +++ b/src/Ganeti/Types.hs
> @@ -329,8 +329,10 @@ $(THH.declareLADT ''String "AllocPolicy"
>         ])
>  $(THH.makeJSONInstance ''AllocPolicy)
>
> --- | The Instance real state type. FIXME: this could be improved to
> --- just wrap a /NormalState AdminStatus | ErrorState ErrorCondition/.
> +-- | The Instance real state type.
> +--
> +-- FIXME: this could be improved to just wrap a /NormalState
> +-- AdminStatus | ErrorState ErrorCondition/.
>  $(THH.declareLADT ''String "InstanceStatus"
>         [ ("StatusDown",    "ADMIN_down")
>         , ("StatusOffline", "ADMIN_offline")
> @@ -339,6 +341,7 @@ $(THH.declareLADT ''String "InstanceStatus"
>         , ("NodeDown",      "ERROR_nodedown")
>         , ("NodeOffline",   "ERROR_nodeoffline")
>         , ("Running",       "running")
> +       , ("UserDown",      "USER_down")
>         , ("WrongNode",     "ERROR_wrongnode")
>         ])
>  $(THH.makeJSONInstance ''InstanceStatus)
> --
> 1.8.4.1
>
>


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