Commit f5a67757 authored by Klaus Aehlig's avatar Klaus Aehlig

Add function to get master candidates from configuration

With luxi daemon taking over part of the job queue management, it will
also be responsible for replicating the queue to all master candidates.
Therefore, add a function to extract the list of master candidates from
the configuration.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarMichele Tartara <mtartara@google.com>
parent a716edba
......@@ -33,6 +33,7 @@ module Ganeti.Config
, getDefaultNicLink
, getDefaultHypervisor
, getInstancesIpByLink
, getMasterCandidates
, getNode
, getInstance
, getGroup
......@@ -129,6 +130,12 @@ getNodeRole cfg node
| nodeOffline node = NROffline
| otherwise = NRRegular
-- | Get the list of master candidates.
getMasterCandidates :: ConfigData -> [Node]
getMasterCandidates cfg =
filter ((==) NRCandidate . getNodeRole cfg)
(map snd . M.toList . fromContainer . configNodes $ cfg)
-- | Returns the default cluster link.
getDefaultNicLink :: ConfigData -> String
getDefaultNicLink =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment