Switch the text file format to single-file
[ganeti-local] / hbal.hs
diff --git a/hbal.hs b/hbal.hs
index aa5cfde..ae4cb80 100644 (file)
--- a/hbal.hs
+++ b/hbal.hs
@@ -59,8 +59,7 @@ options =
     , oPrintInsts
     , oPrintCommands
     , oOneline
-    , oNodeFile
-    , oInstFile
+    , oDataFile
     , oRapiMaster
     , oLuxiSocket
     , oExecJobs
@@ -73,6 +72,7 @@ options =
     , oMinDisk
     , oDiskMoves
     , oDynuFile
+    , oExTags
     , oShowVer
     , oShowHelp
     ]
@@ -184,8 +184,9 @@ main = do
 
   let oneline = optOneline opts
       verbose = optVerbose opts
+      shownodes = optShowNodes opts
 
-  (fixed_nl, il, csf) <- loadExternalData opts
+  (fixed_nl, il, ctags, csf) <- loadExternalData opts
 
   let offline_names = optOffline opts
       all_nodes = Container.elems fixed_nl
@@ -208,6 +209,9 @@ main = do
       nl = Container.map (flip Node.setMdsk m_dsk . flip Node.setMcpu m_cpu)
            nm
 
+  when (not oneline && verbose > 1) $
+       putStrLn $ "Loaded cluster tags: " ++ intercalate "," ctags
+
   when (Container.size il == 0) $ do
          (if oneline then putStrLn $ formatOneline 0 0 0
           else printf "Cluster is empty, exiting.\n")
@@ -234,10 +238,10 @@ main = do
          putStrLn "Initial instance map:"
          putStrLn $ Cluster.printInsts nl il
 
-  when (optShowNodes opts) $
+  when (isJust shownodes) $
        do
          putStrLn "Initial cluster status:"
-         putStrLn $ Cluster.printNodes nl
+         putStrLn $ Cluster.printNodes nl (fromJust shownodes)
 
   let ini_cv = Cluster.compCV nl
       ini_tbl = Cluster.Table nl il ini_cv []
@@ -308,13 +312,13 @@ main = do
          putStrLn "Final instance map:"
          putStr $ Cluster.printInsts fin_nl fin_il
 
-  when (optShowNodes opts) $
+  when (isJust shownodes) $
        do
          let ini_cs = Cluster.totalResources nl
              fin_cs = Cluster.totalResources fin_nl
          putStrLn ""
          putStrLn "Final cluster status:"
-         putStrLn $ Cluster.printNodes fin_nl
+         putStrLn $ Cluster.printNodes fin_nl (fromJust shownodes)
          when (verbose > 3) $
               do
                 printf "Original: mem=%d disk=%d\n"