Revision c38c44ad scripts/gnt-node

b/scripts/gnt-node
24 24
# W0614: Unused import %s from wildcard import (since we need cli)
25 25

  
26 26
import sys
27
from optparse import make_option
28 27

  
29 28
from ganeti.cli import *
30 29
from ganeti import cli
......
625 624
commands = {
626 625
  'add': (AddNode, [ArgUnknown(min=1, max=1)],
627 626
          [DEBUG_OPT,
628
           make_option("-s", "--secondary-ip", dest="secondary_ip",
629
                       help="Specify the secondary ip for the node",
630
                       metavar="ADDRESS", default=None),
631
           make_option("--readd", dest="readd",
632
                       default=False, action="store_true",
633
                       help="Readd old node after replacing it"),
634
           make_option("--no-ssh-key-check", dest="ssh_key_check",
635
                       default=True, action="store_false",
636
                       help="Disable SSH key fingerprint checking"),
627
           cli_option("-s", "--secondary-ip", dest="secondary_ip",
628
                      help="Specify the secondary ip for the node",
629
                      metavar="ADDRESS", default=None),
630
           cli_option("--readd", dest="readd",
631
                      default=False, action="store_true",
632
                      help="Readd old node after replacing it"),
633
           cli_option("--no-ssh-key-check", dest="ssh_key_check",
634
                      default=True, action="store_false",
635
                      help="Disable SSH key fingerprint checking"),
637 636
           ],
638 637
          "[-s ip] [--readd] [--no-ssh-key-check] <node_name>",
639 638
          "Add a node to the cluster"),
640 639
  'evacuate': (EvacuateNode, [ArgNode(min=1, max=1)],
641 640
               [DEBUG_OPT, FORCE_OPT,
642
                make_option("-n", "--new-secondary", dest="dst_node",
643
                            help="New secondary node", metavar="NODE",
644
                            default=None),
645
                make_option("-I", "--iallocator", metavar="<NAME>",
646
                            help="Select new secondary for the instance"
647
                            " automatically using the"
648
                            " <NAME> iallocator plugin",
649
                            default=None, type="string"),
641
                cli_option("-n", "--new-secondary", dest="dst_node",
642
                           help="New secondary node", metavar="NODE",
643
                           default=None),
644
                cli_option("-I", "--iallocator", metavar="<NAME>",
645
                           help="Select new secondary for the instance"
646
                           " automatically using the"
647
                           " <NAME> iallocator plugin",
648
                           default=None, type="string"),
650 649
                ],
651 650
               "[-f] {-I <iallocator> | -n <dst>} <node>",
652 651
               "Relocate the secondary instances from a node"
653 652
               " to other nodes (only for instances with drbd disk template)"),
654 653
  'failover': (FailoverNode, [ArgNode(min=1, max=1)],
655 654
               [DEBUG_OPT, FORCE_OPT,
656
                make_option("--ignore-consistency", dest="ignore_consistency",
657
                            action="store_true", default=False,
658
                            help="Ignore the consistency of the disks on"
659
                            " the secondary"),
655
                cli_option("--ignore-consistency", dest="ignore_consistency",
656
                           action="store_true", default=False,
657
                           help="Ignore the consistency of the disks on"
658
                           " the secondary"),
660 659
                ],
661 660
               "[-f] <node>",
662 661
               "Stops the primary instances on a node and start them on their"
663 662
               " secondary node (only for instances with drbd disk template)"),
664 663
  'migrate': (MigrateNode, [ArgNode(min=1, max=1)],
665 664
               [DEBUG_OPT, FORCE_OPT,
666
                make_option("--non-live", dest="live",
667
                            default=True, action="store_false",
668
                            help="Do a non-live migration (this usually means"
669
                            " freeze the instance, save the state,"
670
                            " transfer and only then resume running on the"
671
                            " secondary node)"),
665
                cli_option("--non-live", dest="live",
666
                           default=True, action="store_false",
667
                           help="Do a non-live migration (this usually means"
668
                           " freeze the instance, save the state,"
669
                           " transfer and only then resume running on the"
670
                           " secondary node)"),
672 671
                ],
673 672
               "[-f] <node>",
674 673
               "Migrate all the primary instance on a node away from it"
......
685 684
  'modify': (SetNodeParams, [ArgNode(min=1, max=1)],
686 685
             [DEBUG_OPT, FORCE_OPT,
687 686
              SUBMIT_OPT,
688
              make_option("-C", "--master-candidate", dest="master_candidate",
689
                          choices=('yes', 'no'), default=None,
690
                          metavar="yes|no",
691
                          help="Set the master_candidate flag on the node"),
692
              make_option("-O", "--offline", dest="offline", metavar="yes|no",
693
                          choices=('yes', 'no'), default=None,
694
                          help="Set the offline flag on the node"),
695
              make_option("-D", "--drained", dest="drained", metavar="yes|no",
696
                          choices=('yes', 'no'), default=None,
697
                          help="Set the drained flag on the node"),
687
              cli_option("-C", "--master-candidate", dest="master_candidate",
688
                         choices=('yes', 'no'), default=None,
689
                         metavar="yes|no",
690
                         help="Set the master_candidate flag on the node"),
691
              cli_option("-O", "--offline", dest="offline", metavar="yes|no",
692
                         choices=('yes', 'no'), default=None,
693
                         help="Set the offline flag on the node"),
694
              cli_option("-D", "--drained", dest="drained", metavar="yes|no",
695
                         choices=('yes', 'no'), default=None,
696
                         help="Set the drained flag on the node"),
698 697
              ],
699 698
             "<node>", "Alters the parameters of a node"),
700 699
  'powercycle': (PowercycleNode, [ArgNode(min=1, max=1)],
......
716 715
                               choices=_MODIFIABLE_STORAGE_TYPES),
717 716
                     ArgFile(min=1, max=1)],
718 717
                    [DEBUG_OPT,
719
                     make_option("--allocatable", dest="allocatable",
720
                                 choices=["yes", "no"], default=None,
721
                                 metavar="yes|no",
722
                                 help="Set the allocatable flag on a volume"),
718
                     cli_option("--allocatable", dest="allocatable",
719
                                choices=["yes", "no"], default=None,
720
                                metavar="yes|no",
721
                                help="Set the allocatable flag on a volume"),
723 722
                     ],
724 723
                    "<node_name> <storage_type> <name>",
725 724
                    "Modify storage volume on a node"),

Also available in: Unified diff