Revision 9b91b5a3 src/Cluster.hs

b/src/Cluster.hs
543 543
    else
544 544
        if c == b then {- Failover and ... -}
545 545
            if d == a then {- that's all -}
546
                ("f", [printf "failover %s" i])
546
                ("f", [printf "migrate %s" i])
547 547
            else
548 548
                (printf "f r:%s" d,
549
                 [printf "failover %s" i,
549
                 [printf "migrate %s" i,
550 550
                  printf "replace-disks -n %s %s" d i])
551 551
        else
552 552
            if d == a then {- ... and keep primary as secondary -}
553 553
                (printf "r:%s f" c,
554 554
                 [printf "replace-disks -n %s %s" c i,
555
                  printf "failover %s" i])
555
                  printf "migrate %s" i])
556 556
            else
557 557
                if d == b then {- ... keep same secondary -}
558 558
                    (printf "f r:%s f" c,
559
                     [printf "failover %s" i,
559
                     [printf "migrate %s" i,
560 560
                      printf "replace-disks -n %s %s" c i,
561
                      printf "failover %s" i])
561
                      printf "migrate %s" i])
562 562

  
563 563
                else {- Nothing in common -}
564 564
                    (printf "r:%s f r:%s" c d,
565 565
                     [printf "replace-disks -n %s %s" c i,
566
                      printf "failover %s" i,
566
                      printf "migrate %s" i,
567 567
                      printf "replace-disks -n %s %s" d i])
568 568

  
569 569
{-| Converts a placement to string format -}
......
597 597
formatCmds cmd_strs =
598 598
    unlines $ map ("  echo " ++) $
599 599
    concat $ map (\(a, b) ->
600
        (printf "step %d" (a::Int)):(map ("gnt-instance" ++) b)) $
600
        (printf "step %d" (a::Int)):(map ("gnt-instance " ++) b)) $
601 601
        zip [1..] cmd_strs
602 602

  
603 603
{-| Converts a solution to string format -}

Also available in: Unified diff