Revision d0c8c01d lib/client/gnt_node.py

b/lib/client/gnt_node.py
174 174
  readd = opts.readd
175 175

  
176 176
  try:
177
    output = cl.QueryNodes(names=[node], fields=['name', 'sip', 'master'],
177
    output = cl.QueryNodes(names=[node], fields=["name", "sip", "master"],
178 178
                           use_locking=False)
179 179
    node_exists, sip, is_master = output[0]
180 180
  except (errors.OpPrereqError, errors.OpExecError):
......
197 197
    sip = opts.secondary_ip
198 198

  
199 199
  # read the cluster name from the master
200
  output = cl.QueryConfigValues(['cluster_name'])
200
  output = cl.QueryConfigValues(["cluster_name"])
201 201
  cluster_name = output[0]
202 202

  
203 203
  if not readd and opts.node_setup:
......
851 851

  
852 852

  
853 853
commands = {
854
  'add': (
854
  "add": (
855 855
    AddNode, [ArgHost(min=1, max=1)],
856 856
    [SECONDARY_IP_OPT, READD_OPT, NOSSH_KEYCHECK_OPT, NODE_FORCE_JOIN_OPT,
857 857
     NONODE_SETUP_OPT, VERBOSE_OPT, NODEGROUP_OPT, PRIORITY_OPT,
......
867 867
    "[-f] {-I <iallocator> | -n <dst>} <node>",
868 868
    "Relocate the secondary instances from a node"
869 869
    " to other nodes"),
870
  'failover': (
870
  "failover": (
871 871
    FailoverNode, ARGS_ONE_NODE, [FORCE_OPT, IGNORE_CONSIST_OPT,
872 872
                                  IALLOCATOR_OPT, PRIORITY_OPT],
873 873
    "[-f] <node>",
874 874
    "Stops the primary instances on a node and start them on their"
875 875
    " secondary node (only for instances with drbd disk template)"),
876
  'migrate': (
876
  "migrate": (
877 877
    MigrateNode, ARGS_ONE_NODE,
878 878
    [FORCE_OPT, NONLIVE_OPT, MIGRATION_MODE_OPT, DST_NODE_OPT,
879 879
     IALLOCATOR_OPT, PRIORITY_OPT],
880 880
    "[-f] <node>",
881 881
    "Migrate all the primary instance on a node away from it"
882 882
    " (only for instances of type drbd)"),
883
  'info': (
883
  "info": (
884 884
    ShowNodeConfig, ARGS_MANY_NODES, [],
885 885
    "[<node_name>...]", "Show information about the node(s)"),
886
  'list': (
886
  "list": (
887 887
    ListNodes, ARGS_MANY_NODES,
888 888
    [NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, VERBOSE_OPT,
889 889
     FORCE_FILTER_OPT],
......
897 897
    [NOHDR_OPT, SEP_OPT],
898 898
    "[fields...]",
899 899
    "Lists all available fields for nodes"),
900
  'modify': (
900
  "modify": (
901 901
    SetNodeParams, ARGS_ONE_NODE,
902 902
    [FORCE_OPT, SUBMIT_OPT, MC_OPT, DRAINED_OPT, OFFLINE_OPT,
903 903
     CAPAB_MASTER_OPT, CAPAB_VM_OPT, SECONDARY_IP_OPT,
904 904
     AUTO_PROMOTE_OPT, DRY_RUN_OPT, PRIORITY_OPT, NODE_PARAMS_OPT,
905 905
     NODE_POWERED_OPT],
906 906
    "<node_name>", "Alters the parameters of a node"),
907
  'powercycle': (
907
  "powercycle": (
908 908
    PowercycleNode, ARGS_ONE_NODE,
909 909
    [FORCE_OPT, CONFIRM_OPT, DRY_RUN_OPT, PRIORITY_OPT],
910 910
    "<node_name>", "Tries to forcefully powercycle a node"),
911
  'power': (
911
  "power": (
912 912
    PowerNode,
913 913
    [ArgChoice(min=1, max=1, choices=_LIST_POWER_COMMANDS),
914 914
     ArgNode()],
......
916 916
     FORCE_OPT, NOHDR_OPT, SEP_OPT, OOB_TIMEOUT_OPT, POWER_DELAY_OPT],
917 917
    "on|off|cycle|status [nodes...]",
918 918
    "Change power state of node by calling out-of-band helper."),
919
  'remove': (
919
  "remove": (
920 920
    RemoveNode, ARGS_ONE_NODE, [DRY_RUN_OPT, PRIORITY_OPT],
921 921
    "<node_name>", "Removes a node from the cluster"),
922
  'volumes': (
922
  "volumes": (
923 923
    ListVolumes, [ArgNode()],
924 924
    [NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, PRIORITY_OPT],
925 925
    "[<node_name>...]", "List logical volumes on node(s)"),
926
  'list-storage': (
926
  "list-storage": (
927 927
    ListStorage, ARGS_MANY_NODES,
928 928
    [NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, _STORAGE_TYPE_OPT,
929 929
     PRIORITY_OPT],
930 930
    "[<node_name>...]", "List physical volumes on node(s). The available"
931 931
    " fields are (see the man page for details): %s." %
932 932
    (utils.CommaJoin(_LIST_STOR_HEADERS))),
933
  'modify-storage': (
933
  "modify-storage": (
934 934
    ModifyStorage,
935 935
    [ArgNode(min=1, max=1),
936 936
     ArgChoice(min=1, max=1, choices=_MODIFIABLE_STORAGE_TYPES),
937 937
     ArgFile(min=1, max=1)],
938 938
    [ALLOCATABLE_OPT, DRY_RUN_OPT, PRIORITY_OPT],
939 939
    "<node_name> <storage_type> <name>", "Modify storage volume on a node"),
940
  'repair-storage': (
940
  "repair-storage": (
941 941
    RepairStorage,
942 942
    [ArgNode(min=1, max=1),
943 943
     ArgChoice(min=1, max=1, choices=_REPAIRABLE_STORAGE_TYPES),
......
945 945
    [IGNORE_CONSIST_OPT, DRY_RUN_OPT, PRIORITY_OPT],
946 946
    "<node_name> <storage_type> <name>",
947 947
    "Repairs a storage volume on a node"),
948
  'list-tags': (
948
  "list-tags": (
949 949
    ListTags, ARGS_ONE_NODE, [],
950 950
    "<node_name>", "List the tags of the given node"),
951
  'add-tags': (
951
  "add-tags": (
952 952
    AddTags, [ArgNode(min=1, max=1), ArgUnknown()], [TAG_SRC_OPT, PRIORITY_OPT],
953 953
    "<node_name> tag...", "Add tags to the given node"),
954
  'remove-tags': (
954
  "remove-tags": (
955 955
    RemoveTags, [ArgNode(min=1, max=1), ArgUnknown()],
956 956
    [TAG_SRC_OPT, PRIORITY_OPT],
957 957
    "<node_name> tag...", "Remove tags from the given node"),

Also available in: Unified diff