LGTM, thanks.

On Tue, Feb 18, 2014 at 3:39 PM, Hrvoje Ribicic <[email protected]> wrote:

> To prepare for the use of sockets to interrupt a running delay opcode,
> this patch adds an option to the opcode for doing so.
>
> Signed-off-by: Hrvoje Ribicic <[email protected]>
> ---
>  src/Ganeti/HTools/Program/Harep.hs | 1 +
>  src/Ganeti/OpCodes.hs              | 1 +
>  src/Ganeti/OpParams.hs             | 8 ++++++++
>  test/hs/Test/Ganeti/OpCodes.hs     | 2 +-
>  4 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/src/Ganeti/HTools/Program/Harep.hs
> b/src/Ganeti/HTools/Program/Harep.hs
> index 933410d..584b439 100644
> --- a/src/Ganeti/HTools/Program/Harep.hs
> +++ b/src/Ganeti/HTools/Program/Harep.hs
> @@ -427,6 +427,7 @@ doRepair client delay instData (rtype, opcodes) =
>                              , opDelayOnNodes = []
>                              , opDelayOnNodeUuids = Nothing
>                              , opDelayRepeat = fromJust $ mkNonNegative 0
> +                            , opDelayInterruptible = False
>                              } : opcodes
>                else
>                  opcodes
> diff --git a/src/Ganeti/OpCodes.hs b/src/Ganeti/OpCodes.hs
> index c80804d..3e8c8ab 100644
> --- a/src/Ganeti/OpCodes.hs
> +++ b/src/Ganeti/OpCodes.hs
> @@ -822,6 +822,7 @@ $(genOpCode "OpCode"
>       , pDelayOnNodes
>       , pDelayOnNodeUuids
>       , pDelayRepeat
> +     , pDelayInterruptible
>       ],
>       "duration")
>    , ("OpTestAllocator",
> diff --git a/src/Ganeti/OpParams.hs b/src/Ganeti/OpParams.hs
> index 7dfe8ef..263f792 100644
> --- a/src/Ganeti/OpParams.hs
> +++ b/src/Ganeti/OpParams.hs
> @@ -227,6 +227,7 @@ module Ganeti.OpParams
>    , pDelayOnNodes
>    , pDelayOnNodeUuids
>    , pDelayRepeat
> +  , pDelayInterruptible
>    , pIAllocatorDirection
>    , pIAllocatorMode
>    , pIAllocatorReqName
> @@ -1524,6 +1525,13 @@ pDelayRepeat =
>    defaultField [| forceNonNeg (0::Int) |] $
>    simpleField "repeat" [t| NonNegative Int |]
>
> +pDelayInterruptible :: Field
> +pDelayInterruptible =
> +  withDoc "Allows socket-based interruption of a running OpTestDelay" .
> +  renameField "DelayInterruptible" .
> +  defaultField [| False |] $
> +  simpleField "interruptible" [t| Bool |]
> +
>  pIAllocatorDirection :: Field
>  pIAllocatorDirection =
>    withDoc "IAllocator test direction" .
> diff --git a/test/hs/Test/Ganeti/OpCodes.hs
> b/test/hs/Test/Ganeti/OpCodes.hs
> index cbaa9dc..3704cbc 100644
> --- a/test/hs/Test/Ganeti/OpCodes.hs
> +++ b/test/hs/Test/Ganeti/OpCodes.hs
> @@ -125,7 +125,7 @@ instance Arbitrary OpCodes.OpCode where
>      case op_id of
>        "OP_TEST_DELAY" ->
>          OpCodes.OpTestDelay <$> arbitrary <*> arbitrary <*>
> -          genNodeNamesNE <*> return Nothing <*> arbitrary
> +          genNodeNamesNE <*> return Nothing <*> arbitrary <*> arbitrary
>        "OP_INSTANCE_REPLACE_DISKS" ->
>          OpCodes.OpInstanceReplaceDisks <$> genFQDN <*> return Nothing <*>
>            arbitrary <*> arbitrary <*> arbitrary <*> genDiskIndices <*>
> --
> 1.9.0.rc1.175.g0b1dcb5
>
>

Reply via email to