LGTM

Thanks,

Guido

On Wed, Dec 12, 2012 at 2:28 AM, Iustin Pop <ius...@google.com> wrote:
> Also fixes indentation for OP_STATUS.
>
> Signed-off-by: Iustin Pop <ius...@google.com>
> ---
>  htest/Test/Ganeti/Types.hs |    7 +++++++
>  htools/Ganeti/Types.hs     |   25 +++++++++++++++++--------
>  2 files changed, 24 insertions(+), 8 deletions(-)
>
> diff --git a/htest/Test/Ganeti/Types.hs b/htest/Test/Ganeti/Types.hs
> index 971b974..7116871 100644
> --- a/htest/Test/Ganeti/Types.hs
> +++ b/htest/Test/Ganeti/Types.hs
> @@ -132,6 +132,8 @@ $(genArbitrary ''OpSubmitPriority)
>
>  $(genArbitrary ''OpStatus)
>
> +$(genArbitrary ''ELogType)
> +
>  -- * Properties
>
>  prop_AllocPolicy_serialisation :: AllocPolicy -> Property
> @@ -352,6 +354,10 @@ prop_JobDependency_serialisation = testSerialisation
>  prop_OpSubmitPriority_serialisation :: OpSubmitPriority -> Property
>  prop_OpSubmitPriority_serialisation = testSerialisation
>
> +-- | Test 'ELogType' serialisation.
> +prop_ELogType_serialisation :: ELogType -> Property
> +prop_ELogType_serialisation = testSerialisation
> +
>  testSuite "Types"
>    [ 'prop_AllocPolicy_serialisation
>    , 'case_AllocPolicy_order
> @@ -394,4 +400,5 @@ testSuite "Types"
>    , 'prop_JobId_serialisation
>    , 'prop_JobDependency_serialisation
>    , 'prop_OpSubmitPriority_serialisation
> +  , 'prop_ELogType_serialisation
>    ]
> diff --git a/htools/Ganeti/Types.hs b/htools/Ganeti/Types.hs
> index a654b92..560159d 100644
> --- a/htools/Ganeti/Types.hs
> +++ b/htools/Ganeti/Types.hs
> @@ -89,6 +89,7 @@ module Ganeti.Types
>    , OpStatus(..)
>    , opStatusToRaw
>    , opStatusFromRaw
> +  , ELogType(..)
>    ) where
>
>  import Control.Monad (liftM)
> @@ -452,12 +453,20 @@ $(THH.makeJSONInstance ''OpSubmitPriority)
>
>  -- | Our ADT for the OpCode status at runtime (while in a job).
>  $(THH.declareSADT "OpStatus"
> -       [ ("OP_STATUS_QUEUED",    'C.opStatusQueued)
> -       , ("OP_STATUS_WAITING",   'C.opStatusWaiting)
> -       , ("OP_STATUS_CANCELING", 'C.opStatusCanceling)
> -       , ("OP_STATUS_RUNNING",   'C.opStatusRunning)
> -       , ("OP_STATUS_CANCELED",  'C.opStatusCanceled)
> -       , ("OP_STATUS_SUCCESS",   'C.opStatusSuccess)
> -       , ("OP_STATUS_ERROR",     'C.opStatusError)
> -       ])
> +  [ ("OP_STATUS_QUEUED",    'C.opStatusQueued)
> +  , ("OP_STATUS_WAITING",   'C.opStatusWaiting)
> +  , ("OP_STATUS_CANCELING", 'C.opStatusCanceling)
> +  , ("OP_STATUS_RUNNING",   'C.opStatusRunning)
> +  , ("OP_STATUS_CANCELED",  'C.opStatusCanceled)
> +  , ("OP_STATUS_SUCCESS",   'C.opStatusSuccess)
> +  , ("OP_STATUS_ERROR",     'C.opStatusError)
> +  ])
>  $(THH.makeJSONInstance ''OpStatus)
> +
> +-- | Type for the job message type.
> +$(THH.declareSADT "ELogType"
> +  [ ("ELogMessage",      'C.elogMessage)
> +  , ("ELogRemoteImport", 'C.elogRemoteImport)
> +  , ("ELogJqueueTest",   'C.elogJqueueTest)
> +  ])
> +$(THH.makeJSONInstance ''ELogType)
> --
> 1.7.10.4
>



-- 
Guido Trotter
SRE - Corp Computing Services (aka Horsepower)
Google Germany

Reply via email to