Skip to content
Snippets Groups Projects
Commit 4e84ca27 authored by Iustin Pop's avatar Iustin Pop
Browse files

htools: add parsing of input node-evac messages


This is a lot of duplication with modeMreloc, which will get sorted
out once we convert mreloc to change-group.

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 3667467d
No related branches found
No related tags found
No related merge requests found
...@@ -192,6 +192,19 @@ parseData body = do ...@@ -192,6 +192,19 @@ parseData body = do
| otherwise -> Bad $ "Invalid relocate mode " ++ s | otherwise -> Bad $ "Invalid relocate mode " ++ s
Bad x -> Bad x Bad x -> Bad x
return $ MultiReloc rl_idx rl_mode return $ MultiReloc rl_idx rl_mode
| optype == C.iallocatorModeNodeEvac ->
do
rl_names <- extrReq "instances"
rl_insts <- mapM (Container.findByName map_i) rl_names
let rl_idx = map Instance.idx rl_insts
rl_mode <-
case extrReq "evac_mode" of
Ok s | s == C.iallocatorNevacAll -> return ChangeAll
| s == C.iallocatorNevacPri -> return ChangePrimary
| s == C.iallocatorNevacSec -> return ChangeSecondary
| otherwise -> Bad $ "Invalid evacuate mode " ++ s
Bad x -> Bad x
return $ NodeEvacuate rl_idx rl_mode
| otherwise -> fail ("Invalid request type '" ++ optype ++ "'") | otherwise -> fail ("Invalid request type '" ++ optype ++ "'")
return $ Request rqtype cdata return $ Request rqtype cdata
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment