Revision 129734d3 htools/Ganeti/HTools/IAlloc.hs

b/htools/Ganeti/HTools/IAlloc.hs
220 220
formatAllocate :: Instance.List -> Cluster.AllocSolution -> Result IAllocResult
221 221
formatAllocate il as = do
222 222
  let info = describeSolution as
223
  case Cluster.asSolutions as of
224
    [] -> fail info
225
    (nl, inst, nodes, _):[] ->
223
  case Cluster.asSolution as of
224
    Nothing -> fail info
225
    Just (nl, inst, nodes, _) ->
226 226
        do
227 227
          let il' = Container.add (Instance.idx inst) inst il
228 228
          return (info, showJSON $ map Node.name nodes, nl, il')
229
    _ -> fail "Internal error: multiple allocation solutions"
230 229

  
231 230
-- | Convert a node-evacuation/change group result.
232 231
formatNodeEvac :: Group.List

Also available in: Unified diff