LGTM, Thanks

On Wed, Dec 4, 2013 at 3:03 PM, Klaus Aehlig <[email protected]> wrote:

> While there is a function to calculate the job status, sometimes
> it is only relevant if the job is finalized. In this case, it is
> more readable not having to know the internal order of JobStatus.
>
> Signed-off-by: Klaus Aehlig <[email protected]>
> ---
>  src/Ganeti/JQueue.hs | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/src/Ganeti/JQueue.hs b/src/Ganeti/JQueue.hs
> index 4594449..c95499f 100644
> --- a/src/Ganeti/JQueue.hs
> +++ b/src/Ganeti/JQueue.hs
> @@ -38,6 +38,7 @@ module Ganeti.JQueue
>      , opStatusFinalized
>      , extractOpSummary
>      , calcJobStatus
> +    , jobFinalized
>      , calcJobPriority
>      , jobFileName
>      , liveJobFile
> @@ -245,6 +246,10 @@ calcJobStatus QueuedJob { qjOps = ops } =
>             | otherwise        = extractOpSt xs (opStatusToJob x) new_all
>             where new_all = x == OP_STATUS_SUCCESS && old_all
>
> +-- | Determine if a job is finalised.
> +jobFinalized :: QueuedJob -> Bool
> +jobFinalized = (> JOB_STATUS_RUNNING) . calcJobStatus
> +
>  -- | Determine whether an opcode status is finalized.
>  opStatusFinalized :: OpStatus -> Bool
>  opStatusFinalized = (> OP_STATUS_RUNNING)
> --
> 1.8.4.1
>
>

Reply via email to