Skip to content
Snippets Groups Projects
Commit d8e9131b authored by Michele Tartara's avatar Michele Tartara
Browse files

Add function to fetch the list of master candidates


This commits adds to the Haskell codebase a function to fetch the list of
IPs of the master candidates from the SSConf database.

Signed-off-by: default avatarMichele Tartara <mtartara@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 1a0defea
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,7 @@ module Ganeti.Ssconf
, sSKeyToRaw
, sSKeyFromRaw
, getPrimaryIPFamily
, getMasterCandidatesIps
, keyToFilename
, sSFilePrefix
) where
......@@ -127,3 +128,9 @@ getPrimaryIPFamily optpath = do
result <- readSSConfFile optpath (Just (show C.ip4Family)) SSPrimaryIpFamily
return (liftM rStripSpace result >>=
tryRead "Parsing af_family" >>= parseIPFamily)
-- | Read the list of IP addresses of the master candidates of the cluster.
getMasterCandidatesIps :: Maybe FilePath -> IO (Result [String])
getMasterCandidatesIps optPath = do
result <- readSSConfFile optPath Nothing SSMasterCandidatesIps
return $ liftM lines result
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment