Revision a1f35d0a src/Ganeti/Config.hs

b/src/Ganeti/Config.hs
35 35
    , getDefaultHypervisor
36 36
    , getInstancesIpByLink
37 37
    , getMasterCandidates
38
    , getOnlineNodes
38 39
    , getNode
39 40
    , getInstance
40 41
    , getGroup
......
56 57
    ) where
57 58

  
58 59
import Control.Monad (liftM)
60
import qualified Data.Foldable as F
59 61
import Data.List (foldl', nub)
60 62
import qualified Data.Map as M
61 63
import qualified Data.Set as S
......
143 145
-- | Get the list of master candidates.
144 146
getMasterCandidates :: ConfigData -> [Node]
145 147
getMasterCandidates cfg = 
146
  filter ((==) NRCandidate . getNodeRole cfg)
147
    (map snd . M.toList . fromContainer . configNodes $ cfg)
148
  filter ((==) NRCandidate . getNodeRole cfg) . F.toList . configNodes $ cfg
149

  
150
-- | Get the list of online nodes.
151
getOnlineNodes :: ConfigData -> [Node]
152
getOnlineNodes = filter (not . nodeOffline) . F.toList . configNodes
148 153

  
149 154
-- | Returns the default cluster link.
150 155
getDefaultNicLink :: ConfigData -> String

Also available in: Unified diff