From 9b91b5a394577281a1ba1a15abfa4a7233dab388 Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Sat, 14 Mar 2009 12:16:52 +0100 Subject: [PATCH] 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. --- src/Cluster.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Cluster.hs b/src/Cluster.hs index 48f72a1ef..284904693 100644 --- a/src/Cluster.hs +++ b/src/Cluster.hs @@ -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 -} -- GitLab