Don't define the set of all daemons twice
authorKlaus Aehlig <aehlig@google.com>
Tue, 30 Jun 2015 15:20:33 +0000 (17:20 +0200)
committerKlaus Aehlig <aehlig@google.com>
Tue, 30 Jun 2015 15:45:40 +0000 (17:45 +0200)
Currently, we have two places where we define the
list of all Ganeti daemons: the type GanetiDaemon
in Ganeti.Runtime and the constant daemons
in Ganeti.Constants. Avoid this duplication by
using Bounded GanetiDaemons and Enum GanetiDaemons.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

src/Ganeti/Constants.hs

index 03b32c5..97093df 100644 (file)
@@ -377,12 +377,8 @@ kvmd = Runtime.daemonName GanetiKvmd
 
 daemons :: FrozenSet String
 daemons =
-  ConstantUtils.mkSet [confd,
-                       luxid,
-                       masterd,
-                       mond,
-                       noded,
-                       rapi]
+  ConstantUtils.mkSet
+  $ map Runtime.daemonName [minBound .. maxBound]
 
 defaultConfdPort :: Int
 defaultConfdPort = 1814