Revision f0753837 htools/Ganeti/HTools/CLI.hs

b/htools/Ganeti/HTools/CLI.hs
44 44
  , oDataFile
45 45
  , oDiskMoves
46 46
  , oDiskTemplate
47
  , oSpindleUse
47 48
  , oDynuFile
48 49
  , oEvacMode
49 50
  , oExInst
......
113 114
  , optDiskMoves   :: Bool           -- ^ Allow disk moves
114 115
  , optInstMoves   :: Bool           -- ^ Allow instance moves
115 116
  , optDiskTemplate :: Maybe DiskTemplate  -- ^ Override for the disk template
117
  , optSpindleUse  :: Maybe Int      -- ^ Override for the spindle usage
116 118
  , optDynuFile    :: Maybe FilePath -- ^ Optional file with dynamic use data
117 119
  , optEvacMode    :: Bool           -- ^ Enable evacuation mode
118 120
  , optExInst      :: [String]       -- ^ Instances to be excluded
......
154 156
  , optDiskMoves   = True
155 157
  , optInstMoves   = True
156 158
  , optDiskTemplate = Nothing
159
  , optSpindleUse  = Nothing
157 160
  , optDynuFile    = Nothing
158 161
  , optEvacMode    = False
159 162
  , optExInst      = []
......
228 231
                           return $ opts { optDiskTemplate = Just dt })
229 232
                 "TEMPLATE") "select the desired disk template"
230 233

  
234
oSpindleUse :: OptType
235
oSpindleUse = Option "" ["spindle-use"]
236
              (ReqArg (\ n opts -> do
237
                         su <- tryRead "parsing spindle-use" n
238
                         when (su < 0) $
239
                              fail "Invalid value of the spindle-use\
240
                                   \ (expected >= 0)"
241
                         return $ opts { optSpindleUse = Just su })
242
               "SPINDLES") "select how many virtual spindle instances use\
243
                           \ [default read from cluster]"
244

  
231 245
oSelInst :: OptType
232 246
oSelInst = Option "" ["select-instances"]
233 247
          (ReqArg (\ f opts -> Ok opts { optSelInst = sepSplit ',' f }) "INSTS")

Also available in: Unified diff