Revision dd77da99

b/htest/Test/Ganeti/HTools/Node.hs
53 53

  
54 54
-- * Arbitrary instances
55 55

  
56
-- | Generas an arbitrary node based on sizing information.
56
-- | Generates an arbitrary node based on sizing information.
57 57
genNode :: Maybe Int -- ^ Minimum node size in terms of units
58 58
        -> Maybe Int -- ^ Maximum node size (when Nothing, bounded
59 59
                     -- just by the max... constants)
......
126 126
prop_addPriFM node inst =
127 127
  Instance.mem inst >= Node.fMem node && not (Node.failN1 node) &&
128 128
  not (Instance.isOffline inst) ==>
129
  case Node.addPri node inst'' of
130
    Bad Types.FailMem -> True
131
    _ -> False
129
  (Node.addPri node inst'' ==? Bad Types.FailMem)
132 130
  where inst' = setInstanceSmallerThanNode node inst
133 131
        inst'' = inst' { Instance.mem = Instance.mem inst }
134 132

  
......
141 139
  let inst' = setInstanceSmallerThanNode node inst
142 140
      inst'' = inst' { Instance.dsk = Instance.dsk inst
143 141
                     , Instance.diskTemplate = dt }
144
  in case Node.addPri node inst'' of
145
       Bad Types.FailDisk -> True
146
       _ -> False
142
  in (Node.addPri node inst'' ==? Bad Types.FailDisk)
147 143

  
148 144
-- | Check that adding a primary instance with too many VCPUs fails
149 145
-- with type FailCPU.
b/htools/Ganeti/HTools/Program/Hspace.hs
122 122
cpuEff = effFn Cluster.csIcpu (fromIntegral . Cluster.csVcpu)
123 123

  
124 124
-- | Holds data for converting a 'Cluster.CStats' structure into
125
-- detailed statictics.
125
-- detailed statistics.
126 126
statsData :: [(String, Cluster.CStats -> String)]
127 127
statsData = [ ("SCORE", printf "%.8f" . Cluster.csScore)
128 128
            , ("INST_CNT", printf "%d" . Cluster.csNinst)

Also available in: Unified diff