On Thu, Nov 7, 2013 at 1:20 PM, Klaus Aehlig <[email protected]> wrote:
> 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: Klaus Aehlig <[email protected]>
> ---
>  src/Ganeti/Config.hs | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/src/Ganeti/Config.hs b/src/Ganeti/Config.hs
> index 3b40565..aa86866 100644
> --- a/src/Ganeti/Config.hs
> +++ b/src/Ganeti/Config.hs
> @@ -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 =
> --
> 1.8.4.1
>

LGTM, thanks.
Michele


-- 
Google Germany GmbH
Dienerstr. 12
80331 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores

Reply via email to