Make some CLI options more consistent
authorIustin Pop <iustin@google.com>
Mon, 2 Nov 2009 09:26:09 +0000 (10:26 +0100)
committerIustin Pop <iustin@google.com>
Fri, 6 Nov 2009 17:13:00 +0000 (18:13 +0100)
Both the simulate and the tiered allocation mode take a machine spec on
input via a comma-separated list. This patch makes this a little bit
more consistent (always use disk,ram,cpu in this order).

Ganeti/HTools/CLI.hs
Ganeti/HTools/Simu.hs

index 8dad35d..89432fc 100644 (file)
@@ -195,7 +195,7 @@ oInstFile = Option "i" ["instances"]
 oNodeSim :: OptType
 oNodeSim = Option "" ["simulate"]
             (ReqArg (\ f o -> Ok o { optNodeSim = Just f }) "SPEC")
-            "simulate an empty cluster, given as 'num_nodes,disk,memory,cpus'"
+            "simulate an empty cluster, given as 'num_nodes,disk,ram,cpu'"
 
 oRapiMaster :: OptType
 oRapiMaster = Option "m" ["master"]
@@ -297,12 +297,11 @@ oTieredSpec = Option "" ["tiered-alloc"]
                           prs <- mapM (tryRead "tiered specs") sp
                           tspec <-
                               case prs of
-                                [cpu, ram, dsk] -> return $ RSpec cpu ram dsk
+                                [dsk, ram, cpu] -> return $ RSpec cpu ram dsk
                                 _ -> Bad $ "Invalid specification: " ++ inp
                           return $ opts { optTieredSpec = Just tspec } )
               "TSPEC")
-             "enable tiered specs allocation, where we decrease the instance\
-             \ spec on failure to allocate and restart the allocation process"
+             "enable tiered specs allocation, given as 'disk,ram,cpu'"
 
 oShowVer :: OptType
 oShowVer = Option "V" ["version"]
index 07656b4..ee0e66a 100644 (file)
@@ -42,7 +42,7 @@ import qualified Ganeti.HTools.Instance as Instance
 parseDesc :: String -> Result (Int, Int, Int, Int)
 parseDesc desc =
     case sepSplit ',' desc of
-      n:d:m:c:[] -> do
+      [n, d, m, c] -> do
         ncount <- tryRead "node count" n
         disk <- tryRead "disk size" d
         mem <- tryRead "memory size" m