diff --git a/scripts/gnt-backup b/scripts/gnt-backup index 4bd6bc14e6464a8bf4772db0d89b8aef7886ab57..2608f87cc39862f1d9f6b2e40ec2c058c73f2798 100755 --- a/scripts/gnt-backup +++ b/scripts/gnt-backup @@ -238,7 +238,8 @@ import_opts = [ cli_option("--no-wait-for-sync", dest="wait_for_sync", default=True, action="store_false", help="Don't wait for sync (DANGEROUS!)"), cli_option("--src-node", dest="src_node", help="Source node", - metavar="<node>"), + metavar="<node>", + completion_suggest=OPT_COMPL_ONE_NODE), cli_option("--src-dir", dest="src_dir", help="Source directory", metavar="<dir>"), cli_option("--no-ip-check", dest="ip_check", default=True, @@ -246,7 +247,8 @@ import_opts = [ " is alive"), cli_option("-I", "--iallocator", metavar="<NAME>", help="Select nodes for the instance automatically using the" - " <NAME> iallocator plugin", default=None, type="string"), + " <NAME> iallocator plugin", default=None, type="string", + completion_suggest=OPT_COMPL_ONE_IALLOCATOR), cli_option("--file-storage-dir", dest="file_storage_dir", help="Relative path under default cluster-wide file storage dir" " to store file-based disks", default=None, @@ -265,13 +267,15 @@ commands = { [DEBUG_OPT, cli_option("--node", dest="nodes", default=[], action="append", help="List only backups stored on this node" - " (can be used multiple times)"), + " (can be used multiple times)", + completion_suggest=OPT_COMPL_ONE_NODE), ], "", "Lists instance exports available in the ganeti cluster"), 'export': (ExportInstance, ARGS_ONE_INSTANCE, [DEBUG_OPT, FORCE_OPT, cli_option("-n", "--node", dest="node", help="Target node", - metavar="<node>"), + metavar="<node>", + completion_suggest=OPT_COMPL_ONE_NODE), cli_option("","--noshutdown", dest="shutdown", action="store_false", default=True, help="Don't shutdown the instance (unsafe)"), ], diff --git a/scripts/gnt-debug b/scripts/gnt-debug index 6592e90122ee9a1b484510812fae8b1d59161982..aec4ee6af2b83cdf6eb66ef4bd702a2b0b77a40e 100755 --- a/scripts/gnt-debug +++ b/scripts/gnt-debug @@ -150,7 +150,8 @@ commands = { " results (out)"), cli_option("--algorithm", dest="allocator", default=None, - help="Allocator algorithm name"), + help="Allocator algorithm name", + completion_suggest=OPT_COMPL_ONE_IALLOCATOR), cli_option("-m", "--mode", default="relocate", choices=["relocate", "allocate"], help="Request mode, either allocate or" @@ -167,7 +168,8 @@ commands = { " definition is of form mac/ip/bridge, if" " missing values are replace by None"), cli_option("-o", "--os-type", default=None, - help="Select os for the instance"), + help="Select os for the instance", + completion_suggest=OPT_COMPL_ONE_OS), cli_option("-p", "--vcpus", default=1, type="int", help="Select number of VCPUs for the instance"), cli_option("--tags", default=None, diff --git a/scripts/gnt-instance b/scripts/gnt-instance index d0a0c807f13f780fe502d966b1e3721264cb497d..fd304dfa2f1c39b104106f5173a7c41ac2c1ae93 100755 --- a/scripts/gnt-instance +++ b/scripts/gnt-instance @@ -1332,10 +1332,12 @@ def SetInstanceParams(opts, args): # options used in more than one cmd node_opt = cli_option("-n", "--node", dest="node", help="Target node", - metavar="<node>") + metavar="<node>", + completion_suggest=OPT_COMPL_ONE_NODE) os_opt = cli_option("-o", "--os-type", dest="os", help="What OS to run", - metavar="<os>") + metavar="<os>", + completion_suggest=OPT_COMPL_ONE_OS) # multi-instance selection options m_force_multi = cli_option("--force-multiple", dest="force_multi", @@ -1409,7 +1411,8 @@ add_opts = [ choices=list(constants.FILE_DRIVER)), cli_option("-I", "--iallocator", metavar="<NAME>", help="Select nodes for the instance automatically using the" - " <NAME> iallocator plugin", default=None, type="string"), + " <NAME> iallocator plugin", default=None, type="string", + completion_suggest=OPT_COMPL_ONE_IALLOCATOR), cli_option("-H", "--hypervisor", dest="hypervisor", help="Hypervisor and hypervisor options, in the format" " hypervisor:option=value,option=value,...", default=None, @@ -1467,7 +1470,8 @@ commands = { [DEBUG_OPT, FORCE_OPT, SUBMIT_OPT, cli_option("-n", "--new-node", dest="target_node", help="Destinattion node", metavar="NODE", - default=None), + default=None, + completion_suggest=OPT_COMPL_ONE_NODE), ], "[-f] <instance>", "Move instance to an arbitrary node" @@ -1531,7 +1535,8 @@ commands = { cli_option("-n", "--new-secondary", dest="new_secondary", help=("New secondary node (for secondary" " node change)"), metavar="NODE", - default=None), + default=None, + completion_suggest=OPT_COMPL_ONE_NODE), cli_option("-p", "--on-primary", dest="on_primary", default=False, action="store_true", help=("Replace the disk(s) on the primary" @@ -1553,7 +1558,8 @@ commands = { " automatically using the" " <NAME> iallocator plugin (enables" " secondary node replacement)", - default=None, type="string"), + default=None, type="string", + completion_suggest=OPT_COMPL_ONE_IALLOCATOR), SUBMIT_OPT, ], "[-s|-p|-n NODE|-I NAME] <instance>", @@ -1601,7 +1607,8 @@ commands = { cli_option("-t", "--type", dest="reboot_type", help="Type of reboot: soft/hard/full", default=constants.INSTANCE_REBOOT_HARD, - type="string", metavar="<REBOOT>"), + metavar="<REBOOT>", + choices=list(constants.REBOOT_TYPES)), cli_option("--ignore-secondaries", dest="ignore_secondaries", default=False, action="store_true", help="Ignore errors from secondaries"), diff --git a/scripts/gnt-node b/scripts/gnt-node index 6aa57f2961d3b930f46e0a696b256f8626e7acf9..6315e58d4fbcfd18aa8fef743cde977316cf2c1d 100755 --- a/scripts/gnt-node +++ b/scripts/gnt-node @@ -640,12 +640,14 @@ commands = { [DEBUG_OPT, FORCE_OPT, cli_option("-n", "--new-secondary", dest="dst_node", help="New secondary node", metavar="NODE", - default=None), + default=None, + completion_suggest=OPT_COMPL_ONE_NODE), cli_option("-I", "--iallocator", metavar="<NAME>", help="Select new secondary for the instance" " automatically using the" " <NAME> iallocator plugin", - default=None, type="string"), + default=None, type="string", + completion_suggest=OPT_COMPL_ONE_IALLOCATOR), ], "[-f] {-I <iallocator> | -n <dst>} <node>", "Relocate the secondary instances from a node" diff --git a/tools/burnin b/tools/burnin index 817aad6ad74989b73e042f2a0b4dde4a5f6038d4..45cff35f1cbc137ed259e29617ed0c0114d3af6c 100755 --- a/tools/burnin +++ b/tools/burnin @@ -101,7 +101,8 @@ class SimpleOpener(urllib.FancyURLopener): OPTIONS = [ cli.cli_option("-o", "--os", dest="os", default=None, help="OS to use during burnin", - metavar="<OS>"), + metavar="<OS>", + completion_suggest=cli.OPT_COMPL_ONE_OS), cli.cli_option("--disk-size", dest="disk_size", help="Disk size (determines disk count)", default="128m", type="string", metavar="<size,size,...>", @@ -165,13 +166,15 @@ OPTIONS = [ help="Disk template (diskless, file, plain or drbd) [drbd]"), cli.cli_option("-n", "--nodes", dest="nodes", default="", help=("Comma separated list of nodes to perform" - " the burnin on (defaults to all nodes)")), + " the burnin on (defaults to all nodes)"), + completion_suggest=cli.OPT_COMPL_MANY_NODES), cli.cli_option("-I", "--iallocator", dest="iallocator", default=None, type="string", help=("Perform the allocation using an iallocator" " instead of fixed node spread (node restrictions no" " longer apply, therefore -n/--nodes must not be" - " used")), + " used"), + completion_suggest=cli.OPT_COMPL_ONE_IALLOCATOR), cli.cli_option("-p", "--parallel", default=False, action="store_true", dest="parallel", help=("Enable parallelization of some operations in"