Revision 72747d91 src/Ganeti/HTools/Cluster.hs

b/src/Ganeti/HTools/Cluster.hs
829 829
      all_msgs = concatMap (solutionDescription mggl) sols
830 830
      goodSols = filterMGResults mggl sols
831 831
      sortedSols = sortMGResults mggl goodSols
832
  in if null sortedSols
833
       then Bad $ if null groups'
834
                    then "no groups for evacuation: allowed groups was" ++
835
                         show allowed_gdxs ++ ", all groups: " ++
836
                         show (map fst groups)
837
                    else intercalate ", " all_msgs
838
       else let (final_group, final_sol) = head sortedSols
839
            in return (final_group, final_sol, all_msgs)
832
  in case sortedSols of
833
       [] -> Bad $ if null groups'
834
                     then "no groups for evacuation: allowed groups was" ++
835
                          show allowed_gdxs ++ ", all groups: " ++
836
                          show (map fst groups)
837
                     else intercalate ", " all_msgs
838
       (final_group, final_sol):_ -> return (final_group, final_sol, all_msgs)
840 839

  
841 840
-- | Try to allocate an instance on a multi-group cluster.
842 841
tryMGAlloc :: Group.List           -- ^ The group list

Also available in: Unified diff