import System.IO.Error (isDoesNotExistError)
import qualified Ganeti.Constants as C
+import qualified Ganeti.Path as Path
import Ganeti.BasicTypes
-import Ganeti.HTools.Utils
+import Ganeti.Utils
-- | Maximum ssconf file size we support.
maxFileSize :: Int
keyToFilename :: Maybe FilePath -- ^ Optional config path override
-> SSKey -- ^ ssconf key
-> FilePath
-keyToFilename optpath key = fromMaybe C.dataDir optpath </>
+keyToFilename optpath key = fromMaybe Path.dataDir optpath </>
sSFilePrefix ++ sSKeyToRaw key
-- | Runs an IO action while transforming any error into 'Bad'
getPrimaryIPFamily :: Maybe FilePath -> IO (Result Socket.Family)
getPrimaryIPFamily optpath = do
result <- readSSConfFile optpath (Just (show C.ip4Family)) SSPrimaryIpFamily
- return (result >>= return . rstripSpace >>=
+ return (liftM rstripSpace result >>=
tryRead "Parsing af_family" >>= parseIPFamily)