Revision 1f9066c0 hspace.hs

b/hspace.hs
63 63
    , oINodes
64 64
    , oMaxCpu
65 65
    , oMinDisk
66
    , oTieredSpec
66 67
    , oShowVer
67 68
    , oShowHelp
68 69
    ]
......
98 99
            , ("MNODE_DSK_AVAIL", printf "%d" . Cluster.csMdsk)
99 100
            ]
100 101

  
101
specData :: [(String, Options -> String)]
102
specData = [ ("MEM", printf "%d" . optIMem)
103
           , ("DSK", printf "%d" . optIDsk)
104
           , ("CPU", printf "%d" . optIVCPUs)
105
           , ("RQN", printf "%d" . optINodes)
102
specData :: [(String, RSpec -> String)]
103
specData = [ ("MEM", printf "%d" . rspecMem)
104
           , ("DSK", printf "%d" . rspecDsk)
105
           , ("CPU", printf "%d" . rspecCpu)
106 106
           ]
107 107

  
108 108
clusterData :: [(String, Cluster.CStats -> String)]
......
179 179
         exitWith $ ExitFailure 1
180 180

  
181 181
  let verbose = optVerbose opts
182
      ispec = optISpec opts
182 183

  
183 184
  (fixed_nl, il, csf) <- loadExternalData opts
184 185

  
185
  printKeys $ map (\(a, fn) -> ("SPEC_" ++ a, fn opts)) specData
186
  printKeys $ map (\(a, fn) -> ("SPEC_" ++ a, fn ispec)) specData
187
  printKeys [ ("SPEC_RQN", printf "%d" (optINodes opts)) ]
186 188

  
187 189
  let num_instances = length $ Container.elems il
188 190

  
......
239 241
         exitWith ExitSuccess
240 242

  
241 243
  let nmlen = Container.maxNameLen nl
242
      newinst = Instance.create "new" (optIMem opts) (optIDsk opts)
243
                (optIVCPUs opts) "ADMIN_down" (-1) (-1)
244
      reqinst = Instance.create "new" (rspecMem ispec) (rspecDsk ispec)
245
                (rspecCpu ispec) "ADMIN_down" (-1) (-1)
244 246

  
245
  let result = iterateDepth nl il newinst req_nodes []
247
  let result = iterateDepth nl il reqinst req_nodes []
246 248
  (ereason, fin_nl, ixes) <- (case result of
247 249
                                Bad s -> do
248 250
                                  hPrintf stderr "Failure: %s\n" s

Also available in: Unified diff