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

Use gnt-instance migrate instead of failover

This patch changes the gnt-instance failover to migrate, and fixes a bug
in the formatting of commands.
parent 7eff5b09
No related branches found
No related tags found
No related merge requests found
......@@ -543,27 +543,27 @@ computeMoves i a b c d =
else
if c == b then {- Failover and ... -}
if d == a then {- that's all -}
("f", [printf "failover %s" i])
("f", [printf "migrate %s" i])
else
(printf "f r:%s" d,
[printf "failover %s" i,
[printf "migrate %s" i,
printf "replace-disks -n %s %s" d i])
else
if d == a then {- ... and keep primary as secondary -}
(printf "r:%s f" c,
[printf "replace-disks -n %s %s" c i,
printf "failover %s" i])
printf "migrate %s" i])
else
if d == b then {- ... keep same secondary -}
(printf "f r:%s f" c,
[printf "failover %s" i,
[printf "migrate %s" i,
printf "replace-disks -n %s %s" c i,
printf "failover %s" i])
printf "migrate %s" i])
else {- Nothing in common -}
(printf "r:%s f r:%s" c d,
[printf "replace-disks -n %s %s" c i,
printf "failover %s" i,
printf "migrate %s" i,
printf "replace-disks -n %s %s" d i])
{-| Converts a placement to string format -}
......@@ -597,7 +597,7 @@ formatCmds :: [[String]] -> String
formatCmds cmd_strs =
unlines $ map (" echo " ++) $
concat $ map (\(a, b) ->
(printf "step %d" (a::Int)):(map ("gnt-instance" ++) b)) $
(printf "step %d" (a::Int)):(map ("gnt-instance " ++) b)) $
zip [1..] cmd_strs
{-| Converts a solution to string format -}
......
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