Revision 9f8b97ce htools/Ganeti/HTools/IAlloc.hs
b/htools/Ganeti/HTools/IAlloc.hs | ||
---|---|---|
184 | 184 |
rl_names <- extrReq "instances" |
185 | 185 |
rl_insts <- mapM (Container.findByName map_i) rl_names |
186 | 186 |
let rl_idx = map Instance.idx rl_insts |
187 |
rl_mode <- |
|
188 |
case extrReq "evac_mode" of |
|
189 |
Ok s | s == C.iallocatorNevacAll -> return ChangeAll |
|
190 |
| s == C.iallocatorNevacPri -> return ChangePrimary |
|
191 |
| s == C.iallocatorNevacSec -> return ChangeSecondary |
|
192 |
| otherwise -> Bad $ "Invalid evacuate mode " ++ s |
|
193 |
Bad x -> Bad x |
|
187 |
rl_mode <- extrReq "evac_mode" |
|
194 | 188 |
return $ NodeEvacuate rl_idx rl_mode |
195 | 189 |
|
196 | 190 |
| otherwise -> fail ("Invalid request type '" ++ optype ++ "'") |
Also available in: Unified diff