On 15 March 2013 12:31, Michele Tartara <[email protected]> wrote:
> Add status information as required by the design document.
>
> Signed-off-by: Michele Tartara <[email protected]>
> ---
>  src/Ganeti/DataCollectors/Drbd.hs |   77 
> ++++++++++++++++++++++++++++++++++---
>  1 file changed, 71 insertions(+), 6 deletions(-)

LGTM, except...

> @@ -134,11 +196,14 @@ buildJsonReport statusFile pairingFile = do
>        exitIfBad "reading from file" . either (BT.Bad . show) BT.Ok
>    pairingResult <- getPairingInfo pairingFile
>    pairing <- exitIfBad "Can't get pairing info" pairingResult
> -  case A.parse (drbdStatusParser pairing) $ pack contents of
> -    A.Fail unparsedText contexts errorMessage -> exitErr $
> -      show (Prelude.take defaultCharNum $ unpack unparsedText) ++ "\n"
> -        ++ show contexts ++ "\n" ++ errorMessage
> -    A.Done _ drbdStatus -> return $ J.showJSON drbdStatus
> +  drbdData <-
> +    case A.parse (drbdStatusParser pairing) $ pack contents of
> +      A.Fail unparsedText contexts errorMessage -> exitErr $
> +        show (Prelude.take defaultCharNum $ unpack unparsedText) ++ "\n"
> +          ++ show contexts ++ "\n" ++ errorMessage
> +      A.Done _ drbdS -> return drbdS
> +  let status = computeStatus drbdData
> +  return . addStatus status $ J.showJSON drbdData

Maybe it's just the fact that I'm not familiar with Haskell enough,
but why a "." here? Should a parenthesis or a "$" be the same (and
more natural)?

Thanks,
Bernardo

Reply via email to