Change fromObj error messages
[ganeti-local] / Ganeti / HTools / ExtLoader.hs
index a54da1a..41c8453 100644 (file)
@@ -31,6 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 
 module Ganeti.HTools.ExtLoader
     ( loadExternalData
+    , Loader.commonSuffix
     ) where
 
 import Data.Maybe (isJust, fromJust)
@@ -73,7 +74,7 @@ parseUtilisation line =
 
 -- | External tool data loader from a variety of sources.
 loadExternalData :: Options
-                 -> IO (Node.List, Instance.List, [String], String)
+                 -> IO (Node.List, Instance.List, [String])
 loadExternalData opts = do
   let mhost = optMaster opts
       lsock = optLuxi opts
@@ -87,6 +88,7 @@ loadExternalData opts = do
       exTags = case optExTags opts of
                  Nothing -> []
                  Just etl -> map (++ ":") etl
+      exInsts = optExInst opts
 
   when (length allSet > 1) $
        do
@@ -117,12 +119,13 @@ loadExternalData opts = do
           | setFile -> wrapIO $ Text.loadData $ fromJust tfile
           | otherwise -> return $ Bad "No backend selected! Exiting."
 
-  let ldresult = input_data >>= Loader.mergeData util_data' exTags
-  (loaded_nl, il, tags, csf) <-
+  let ldresult = input_data >>= Loader.mergeData util_data' exTags exInsts
+  (loaded_nl, il, tags) <-
       (case ldresult of
          Ok x -> return x
          Bad s -> do
            hPrintf stderr "Error: failed to load data. Details:\n%s\n" s
+               :: IO ()
            exitWith $ ExitFailure 1
       )
   let (fix_msgs, fixed_nl) = Loader.checkData loaded_nl il
@@ -131,4 +134,4 @@ loadExternalData opts = do
          hPutStrLn stderr "Warning: cluster has inconsistent data:"
          hPutStrLn stderr . unlines . map (printf "  - %s") $ fix_msgs
 
-  return (fixed_nl, il, tags, csf)
+  return (fixed_nl, il, tags)