On Wed, Aug 13, 2014 at 10:33:35AM +0200, Aaron Karper wrote:
> Good catch!
> 
> diff --git a/src/Ganeti/DataCollectors/Types.hs
> b/src/Ganeti/DataCollectors/Types.hs
> index e43dfd6..5081e39 100644
> --- a/src/Ganeti/DataCollectors/Types.hs
> +++ b/src/Ganeti/DataCollectors/Types.hs
> @@ -52,7 +52,7 @@ import Ganeti.Utils (getCurrentTime)
> 
>  -- | The possible classes a data collector can belong to.
>  data DCCategory = DCInstance | DCStorage | DCDaemon | DCHypervisor
> -  deriving (Show, Eq, Read)
> +  deriving (Show, Eq, Read, Enum, Bounded)
> 
>  -- | Get the category name and return it as a string.
>  getCategoryName :: DCCategory -> String
> @@ -60,7 +60,7 @@ getCategoryName dcc = map toLower . drop 2 . show $ dcc
> 
>  categoryNames :: Map.Map String DCCategory
>  categoryNames =
> -  let l = [DCInstance, DCStorage, DCDaemon, DCHypervisor]
> +  let l = [minBound ..]
>    in Map.fromList $ zip (map getCategoryName l) l
> 
>  -- | The JSON instance for DCCategory.

LGTM

-- 
Klaus Aehlig
Google Germany GmbH, Dienerstr. 12, 80331 Muenchen
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschaeftsfuehrer: Graham Law, Christine Elizabeth Flores

Reply via email to