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: Michele Tartara <mtartara@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
, sSKeyToRaw
, sSKeyFromRaw
, getPrimaryIPFamily
+ , getMasterCandidatesIps
, keyToFilename
, sSFilePrefix
) where
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