Revision 66ad857a

b/htest/Test/Ganeti/BasicTypes.hs
45 45
{-# ANN module "HLint: ignore Monad law, left identity" #-}
46 46
{-# ANN module "HLint: ignore Monad law, right identity" #-}
47 47
{-# ANN module "HLint: ignore Use >=>" #-}
48
{-# ANN module "HLint: ignore Use ." #-}
48 49

  
49 50
-- * Arbitrary instances
50 51

  
b/htest/Test/Ganeti/HTools/Loader.hs
64 64
        Loader.assignIndices (map (\n -> (Node.name n, n)) nodes)
65 65
  in Map.size nassoc == length nodes &&
66 66
     Container.size kt == length nodes &&
67
     if not (null nodes)
68
       then maximum (IntMap.keys kt) == length nodes - 1
69
       else True
67
     (null nodes || maximum (IntMap.keys kt) == length nodes - 1)
70 68

  
71 69
-- | Checks that the number of primary instances recorded on the nodes
72 70
-- is zero.
b/htools/Ganeti/HTools/Cluster.hs
828 828
      goodSols = filterMGResults mggl sols
829 829
      sortedSols = sortMGResults mggl goodSols
830 830
  in if null sortedSols
831
       then if null groups'
832
              then Bad $ "no groups for evacuation: allowed groups was" ++
833
                     show allowed_gdxs ++ ", all groups: " ++
834
                     show (map fst groups)
835
              else Bad $ intercalate ", " all_msgs
831
       then Bad $ if null groups'
832
                    then "no groups for evacuation: allowed groups was" ++
833
                         show allowed_gdxs ++ ", all groups: " ++
834
                         show (map fst groups)
835
                    else intercalate ", " all_msgs
836 836
       else let (final_group, final_sol) = head sortedSols
837 837
            in return (final_group, final_sol, all_msgs)
838 838

  
b/htools/Ganeti/HTools/Program/Hcheck.hs
312 312
      clusterstats = map sum . transpose . map snd $ groupsstats
313 313
      needrebalance = clusterNeedsRebalance clusterstats
314 314

  
315
  unless (verbose == 0 || machineread) $
316
    if nosimulation
317
      then putStrLn "Running in no-simulation mode."
318
      else if needrebalance
319
             then putStrLn "Cluster needs rebalancing."
320
             else putStrLn "No need to rebalance cluster, no problems found."
315
  unless (verbose == 0 || machineread) .
316
    putStrLn $ if nosimulation
317
                 then "Running in no-simulation mode."
318
                 else if needrebalance
319
                        then "Cluster needs rebalancing."
320
                        else "No need to rebalance cluster, no problems found."
321 321

  
322 322
  mapM_ (printGroupStats verbose machineread Initial) groupsstats
323 323

  
b/htools/Ganeti/Luxi.hs
287 287
recvMsgExt :: Client -> IO RecvResult
288 288
recvMsgExt s =
289 289
  catch (liftM RecvOk (recvMsg s)) $ \e ->
290
    if isEOFError e
291
      then return RecvConnClosed
292
      else return $ RecvError (show e)
290
    return $ if isEOFError e
291
               then RecvConnClosed
292
               else RecvError (show e)
293 293

  
294 294
-- | Serialize a request to String.
295 295
buildCall :: LuxiOp  -- ^ The method

Also available in: Unified diff