Revision 317b1040 hspace.hs

b/hspace.hs
296 296
  printKeys $ printStats PInitial ini_stats
297 297

  
298 298
  let bad_nodes = fst $ Cluster.computeBadItems nl il
299
  when (length bad_nodes > 0) $ do
300
         -- This is failn1 case, so we print the same final stats and
301
         -- exit early
302
         printResults nl num_instances 0 [(FailN1, 1)]
303
         exitWith ExitSuccess
299
      stop_allocation = length bad_nodes > 0
300
      result_noalloc = ([(FailN1, 1)]::FailStats, nl, [])
304 301

  
305 302
  -- utility functions
306 303
  let iofspec spx = Instance.create "new" (rspecMem spx) (rspecDsk spx)
......
319 316
  (case optTieredSpec opts of
320 317
     Nothing -> return ()
321 318
     Just tspec -> do
322
       let tresu = tieredAlloc nl il (iofspec tspec) req_nodes []
323
       (_, trl_nl, trl_ixes) <- exitifbad tresu
319
       (_, trl_nl, trl_ixes) <-
320
           if stop_allocation
321
           then return result_noalloc
322
           else exitifbad (tieredAlloc nl il (iofspec tspec) req_nodes [])
324 323
       let fin_trl_ixes = reverse trl_ixes
325 324
           ix_byspec = groupBy ((==) `on` Instance.specOf) fin_trl_ixes
326 325
           spec_map = map (\ixs -> (Instance.specOf $ head ixs, length ixs))
......
347 346

  
348 347
  -- Run the standard (avg-mode) allocation
349 348

  
350
  let result = iterateDepth nl il reqinst req_nodes []
351
  (ereason, fin_nl, ixes) <- exitifbad result
349
  (ereason, fin_nl, ixes) <-
350
      if stop_allocation
351
      then return result_noalloc
352
      else exitifbad (iterateDepth nl il reqinst req_nodes [])
352 353

  
353 354
  let allocs = length ixes
354 355
      fin_ixes = reverse ixes

Also available in: Unified diff