Signed-off-by: Aaron Karper <[email protected]> --- src/Ganeti/DataCollectors/Types.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Ganeti/DataCollectors/Types.hs b/src/Ganeti/DataCollectors/Types.hs index e43dfd6..7d6ab53 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) -- | 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 = [DCInstance ..] in Map.fromList $ zip (map getCategoryName l) l -- | The JSON instance for DCCategory. -- 2.1.0.rc2.206.gedb03e5
