Revision 4e84ca27 htools/Ganeti/HTools/IAlloc.hs
b/htools/Ganeti/HTools/IAlloc.hs | ||
---|---|---|
192 | 192 |
| otherwise -> Bad $ "Invalid relocate mode " ++ s |
193 | 193 |
Bad x -> Bad x |
194 | 194 |
return $ MultiReloc rl_idx rl_mode |
195 |
| optype == C.iallocatorModeNodeEvac -> |
|
196 |
do |
|
197 |
rl_names <- extrReq "instances" |
|
198 |
rl_insts <- mapM (Container.findByName map_i) rl_names |
|
199 |
let rl_idx = map Instance.idx rl_insts |
|
200 |
rl_mode <- |
|
201 |
case extrReq "evac_mode" of |
|
202 |
Ok s | s == C.iallocatorNevacAll -> return ChangeAll |
|
203 |
| s == C.iallocatorNevacPri -> return ChangePrimary |
|
204 |
| s == C.iallocatorNevacSec -> return ChangeSecondary |
|
205 |
| otherwise -> Bad $ "Invalid evacuate mode " ++ s |
|
206 |
Bad x -> Bad x |
|
207 |
return $ NodeEvacuate rl_idx rl_mode |
|
195 | 208 |
|
196 | 209 |
| otherwise -> fail ("Invalid request type '" ++ optype ++ "'") |
197 | 210 |
return $ Request rqtype cdata |
Also available in: Unified diff