From 064c21f8d579ac364e62272ab5c3253263d06c45 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Thu, 17 Sep 2009 15:25:55 +0200 Subject: [PATCH] Remove explicit DEBUG_OPT and add it by default MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Since >90% of the commands take the “--debug” option, and all should actually take it (the gnt-job command is currently missing it), it makes sense to simply remove this and add it by default in cli.py. Signed-off-by: Iustin Pop Reviewed-by: Michael Hanselmann --- autotools/build-bash-completion | 2 ++ lib/cli.py | 2 +- scripts/gnt-backup | 8 ++--- scripts/gnt-cluster | 42 +++++++++++----------- scripts/gnt-debug | 8 ++--- scripts/gnt-instance | 73 ++++++++++++++++++--------------------- scripts/gnt-job | 12 +++---- scripts/gnt-node | 43 ++++++++++------------- scripts/gnt-os | 5 ++- 9 files changed, 88 insertions(+), 107 deletions(-) diff --git a/autotools/build-bash-completion b/autotools/build-bash-completion index cb738cd..c94ad26 100755 --- a/autotools/build-bash-completion +++ b/autotools/build-bash-completion @@ -591,6 +591,8 @@ def GetCommands(filename, module): for (_, _, optdef, _, _) in commands.itervalues(): if help_option not in optdef: optdef.append(help_option) + if cli.DEBUG_OPT not in optdef: + optdef.append(cli.DEBUG_OPT) # Use aliases aliases = getattr(module, "aliases", {}) diff --git a/lib/cli.py b/lib/cli.py index 5ec00ec..2cc8175 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -876,7 +876,7 @@ def _ParseArgs(argv, commands, aliases): cmd = aliases[cmd] func, args_def, parser_opts, usage, description = commands[cmd] - parser = OptionParser(option_list=parser_opts + [_DRY_RUN_OPT], + parser = OptionParser(option_list=parser_opts + [_DRY_RUN_OPT, DEBUG_OPT], description=description, formatter=TitledHelpFormatter(), usage="%%prog %s %s" % (cmd, usage)) diff --git a/scripts/gnt-backup b/scripts/gnt-backup index 306928f..ae5c601 100755 --- a/scripts/gnt-backup +++ b/scripts/gnt-backup @@ -210,7 +210,6 @@ def RemoveExport(opts, args): # this is defined separately due to readability only import_opts = [ - DEBUG_OPT, NODE_PLACEMENT_OPT, BACKEND_OPT, DISK_TEMPLATE_OPT, @@ -231,11 +230,11 @@ import_opts = [ commands = { 'list': ( PrintExportList, ARGS_NONE, - [DEBUG_OPT, NODE_LIST_OPT], + [NODE_LIST_OPT], "", "Lists instance exports available in the ganeti cluster"), 'export': ( ExportInstance, ARGS_ONE_INSTANCE, - [DEBUG_OPT, FORCE_OPT, SINGLE_NODE_OPT, NOSHUTDOWN_OPT], + [FORCE_OPT, SINGLE_NODE_OPT, NOSHUTDOWN_OPT], "-n [opts...] ", "Exports an instance to an image"), 'import': ( @@ -243,8 +242,7 @@ commands = { "[...] -t disk-type -n node[:secondary-node] ", "Imports an instance from an exported image"), 'remove': ( - RemoveExport, [ArgUnknown(min=1, max=1)], - [DEBUG_OPT], + RemoveExport, [ArgUnknown(min=1, max=1)], [], "", "Remove exports of named instance from the filesystem."), } diff --git a/scripts/gnt-cluster b/scripts/gnt-cluster index 2f35bd9..58a9b9f 100755 --- a/scripts/gnt-cluster +++ b/scripts/gnt-cluster @@ -597,79 +597,77 @@ def WatcherOps(opts, args): commands = { 'init': ( InitCluster, [ArgHost(min=1, max=1)], - [DEBUG_OPT, BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, GLOBAL_FILEDIR_OPT, + [BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, GLOBAL_FILEDIR_OPT, HVLIST_OPT, MAC_PREFIX_OPT, MASTER_NETDEV_OPT, NIC_PARAMS_OPT, NOLVM_STORAGE_OPT, NOMODIFY_ETCHOSTS_OPT, SECONDARY_IP_OPT, VG_NAME_OPT], "[opts...] ", "Initialises a new cluster configuration"), 'destroy': ( - DestroyCluster, ARGS_NONE, - [DEBUG_OPT, YES_DOIT_OPT], + DestroyCluster, ARGS_NONE, [YES_DOIT_OPT], "", "Destroy cluster"), 'rename': ( RenameCluster, [ArgHost(min=1, max=1)], - [DEBUG_OPT, FORCE_OPT], + [FORCE_OPT], "", "Renames the cluster"), 'redist-conf': ( - RedistributeConfig, ARGS_NONE, [DEBUG_OPT, SUBMIT_OPT], + RedistributeConfig, ARGS_NONE, [SUBMIT_OPT], "", "Forces a push of the configuration file and ssconf files" " to the nodes in the cluster"), 'verify': ( VerifyCluster, ARGS_NONE, - [DEBUG_OPT, VERBOSE_OPT, DEBUG_SIMERR_OPT, ERROR_CODES_OPT, NONPLUS1_OPT], + [VERBOSE_OPT, DEBUG_SIMERR_OPT, ERROR_CODES_OPT, NONPLUS1_OPT], "", "Does a check on the cluster configuration"), 'verify-disks': ( - VerifyDisks, ARGS_NONE, [DEBUG_OPT], + VerifyDisks, ARGS_NONE, [], "", "Does a check on the cluster disk status"), 'repair-disk-sizes': ( - RepairDiskSizes, ARGS_MANY_INSTANCES, [DEBUG_OPT], + RepairDiskSizes, ARGS_MANY_INSTANCES, [], "", "Updates mismatches in recorded disk sizes"), 'masterfailover': ( - MasterFailover, ARGS_NONE, [DEBUG_OPT, NOVOTING_OPT], + MasterFailover, ARGS_NONE, [NOVOTING_OPT], "", "Makes the current node the master"), 'version': ( - ShowClusterVersion, ARGS_NONE, [DEBUG_OPT], + ShowClusterVersion, ARGS_NONE, [], "", "Shows the cluster version"), 'getmaster': ( - ShowClusterMaster, ARGS_NONE, [DEBUG_OPT], + ShowClusterMaster, ARGS_NONE, [], "", "Shows the cluster master"), 'copyfile': ( ClusterCopyFile, [ArgFile(min=1, max=1)], - [DEBUG_OPT, NODE_LIST_OPT], + [NODE_LIST_OPT], "[-n node...] ", "Copies a file to all (or only some) nodes"), 'command': ( RunClusterCommand, [ArgCommand(min=1)], - [DEBUG_OPT, NODE_LIST_OPT], + [NODE_LIST_OPT], "[-n node...] ", "Runs a command on all (or only some) nodes"), 'info': ( - ShowClusterConfig, ARGS_NONE, [DEBUG_OPT], + ShowClusterConfig, ARGS_NONE, [], "", "Show cluster configuration"), 'list-tags': ( - ListTags, ARGS_NONE, - [DEBUG_OPT], "", "List the tags of the cluster"), + ListTags, ARGS_NONE, [], "", "List the tags of the cluster"), 'add-tags': ( - AddTags, [ArgUnknown()], [DEBUG_OPT, TAG_SRC_OPT], + AddTags, [ArgUnknown()], [TAG_SRC_OPT], "tag...", "Add tags to the cluster"), 'remove-tags': ( - RemoveTags, [ArgUnknown()], [DEBUG_OPT, TAG_SRC_OPT], + RemoveTags, [ArgUnknown()], [TAG_SRC_OPT], "tag...", "Remove tags from the cluster"), 'search-tags': ( SearchTags, [ArgUnknown(min=1, max=1)], - [DEBUG_OPT], "", "Searches the tags on all objects on" + [], "", "Searches the tags on all objects on" " the cluster for a given pattern (regex)"), 'queue': ( QueueOps, [ArgChoice(min=1, max=1, choices=["drain", "undrain", "info"])], - [DEBUG_OPT], "drain|undrain|info", "Change queue properties"), + [], "drain|undrain|info", "Change queue properties"), 'watcher': ( WatcherOps, [ArgChoice(min=1, max=1, choices=["pause", "continue", "info"]), ArgSuggest(min=0, max=1, choices=["30m", "1h", "4h"])], - [DEBUG_OPT], + [], "{pause |continue|info}", "Change watcher properties"), 'modify': ( SetClusterParams, ARGS_NONE, - [DEBUG_OPT, BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, HVLIST_OPT, + [BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, HVLIST_OPT, NIC_PARAMS_OPT, NOLVM_STORAGE_OPT, VG_NAME_OPT], "[opts...]", "Alters the parameters of the cluster"), diff --git a/scripts/gnt-debug b/scripts/gnt-debug index 1514c16..385ccb8 100755 --- a/scripts/gnt-debug +++ b/scripts/gnt-debug @@ -156,8 +156,7 @@ def TestAllocator(opts, args): commands = { 'delay': ( Delay, [ArgUnknown(min=1, max=1)], - [DEBUG_OPT, - cli_option("--no-master", dest="on_master", default=True, + [cli_option("--no-master", dest="on_master", default=True, action="store_false", help="Do not sleep in the master code"), cli_option("-n", dest="on_nodes", default=[], action="append", help="Select nodes to sleep on"), @@ -165,7 +164,7 @@ commands = { "[opts...] ", "Executes a TestDelay OpCode"), 'submit-job': ( GenericOpCodes, [ArgFile(min=1)], - [DEBUG_OPT, VERBOSE_OPT, + [VERBOSE_OPT, cli_option("--op-repeat", type="int", default="1", dest="rep_op", help="Repeat the opcode sequence this number of times"), cli_option("--job-repeat", type="int", default="1", dest="rep_job", @@ -177,8 +176,7 @@ commands = { " containing a list of serialized opcodes"), 'allocator': ( TestAllocator, ARGS_ONE_INSTANCE, - [DEBUG_OPT, - cli_option("--dir", dest="direction", + [cli_option("--dir", dest="direction", default="in", choices=["in", "out"], help="Show allocator input (in) or allocator" " results (out)"), diff --git a/scripts/gnt-instance b/scripts/gnt-instance index 95821de..3aa2eb9 100755 --- a/scripts/gnt-instance +++ b/scripts/gnt-instance @@ -1357,22 +1357,21 @@ m_inst_opt = cli_option("--instance", dest="multi_mode", # this is defined separately due to readability only add_opts = [ - DEBUG_OPT, - NODE_PLACEMENT_OPT, - OS_OPT, BACKEND_OPT, - DISK_TEMPLATE_OPT, - OS_SIZE_OPT, DISK_OPT, - NET_OPT, - NONICS_OPT, - NWSYNC_OPT, - NOSTART_OPT, - NOIPCHECK_OPT, + DISK_TEMPLATE_OPT, FILESTORE_DIR_OPT, FILESTORE_DRIVER_OPT, - IALLOCATOR_OPT, HYPERVISOR_OPT, + IALLOCATOR_OPT, + NET_OPT, + NODE_PLACEMENT_OPT, + NOIPCHECK_OPT, + NONICS_OPT, + NOSTART_OPT, + NWSYNC_OPT, + OS_OPT, + OS_SIZE_OPT, SUBMIT_OPT, ] @@ -1382,37 +1381,36 @@ commands = { "[...] -t disk-type -n node[:secondary-node] -o os-type ", "Creates and adds a new instance to the cluster"), 'batch-create': ( - BatchCreate, [ArgFile(min=1, max=1)], - [DEBUG_OPT], + BatchCreate, [ArgFile(min=1, max=1)], [], "", "Create a bunch of instances based on specs in the file."), 'console': ( ConnectToInstanceConsole, ARGS_ONE_INSTANCE, - [DEBUG_OPT, SHOWCMD_OPT], + [SHOWCMD_OPT], "[--show-cmd] ", "Opens a console on the specified instance"), 'failover': ( FailoverInstance, ARGS_ONE_INSTANCE, - [DEBUG_OPT, FORCE_OPT, IGNORE_CONSIST_OPT, SUBMIT_OPT], + [FORCE_OPT, IGNORE_CONSIST_OPT, SUBMIT_OPT], "[-f] ", "Stops the instance and starts it on the backup node," " using the remote mirror (only for instances of type drbd)"), 'migrate': ( MigrateInstance, ARGS_ONE_INSTANCE, - [DEBUG_OPT, FORCE_OPT, NONLIVE_OPT, CLEANUP_OPT], + [FORCE_OPT, NONLIVE_OPT, CLEANUP_OPT], "[-f] ", "Migrate instance to its secondary node" " (only for instances of type drbd)"), 'move': ( MoveInstance, ARGS_ONE_INSTANCE, - [DEBUG_OPT, FORCE_OPT, SUBMIT_OPT, SINGLE_NODE_OPT], + [FORCE_OPT, SUBMIT_OPT, SINGLE_NODE_OPT], "[-f] ", "Move instance to an arbitrary node" " (only for instances of type file and lv)"), 'info': ( ShowInstanceConfig, ARGS_MANY_INSTANCES, - [DEBUG_OPT, STATIC_OPT, ALL_OPT], + [STATIC_OPT, ALL_OPT], "[-s] {--all | ...}", "Show information on the specified instance(s)"), 'list': ( ListInstances, ARGS_MANY_INSTANCES, - [DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, SYNC_OPT], + [NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, SYNC_OPT], "[...]", "Lists the instances and their status. The available fields are" " (see the man page for details): status, oper_state, oper_ram," @@ -1424,74 +1422,69 @@ commands = { ), 'reinstall': ( ReinstallInstance, [ArgInstance(min=1)], - [DEBUG_OPT, FORCE_OPT, OS_OPT, m_force_multi, m_node_opt, m_pri_node_opt, + [FORCE_OPT, OS_OPT, m_force_multi, m_node_opt, m_pri_node_opt, m_sec_node_opt, m_clust_opt, m_inst_opt, SELECT_OS_OPT, SUBMIT_OPT], "[-f] ", "Reinstall a stopped instance"), 'remove': ( RemoveInstance, ARGS_ONE_INSTANCE, - [DEBUG_OPT, FORCE_OPT, IGNORE_FAILURES_OPT, SUBMIT_OPT], + [FORCE_OPT, IGNORE_FAILURES_OPT, SUBMIT_OPT], "[-f] ", "Shuts down the instance and removes it"), 'rename': ( RenameInstance, [ArgInstance(min=1, max=1), ArgHost(min=1, max=1)], - [DEBUG_OPT, NOIPCHECK_OPT, SUBMIT_OPT], + [NOIPCHECK_OPT, SUBMIT_OPT], " ", "Rename the instance"), 'replace-disks': ( ReplaceDisks, ARGS_ONE_INSTANCE, - [DEBUG_OPT, AUTO_REPLACE_OPT, DISKIDX_OPT, IALLOCATOR_OPT, + [AUTO_REPLACE_OPT, DISKIDX_OPT, IALLOCATOR_OPT, NEW_SECONDARY_OPT, ON_PRIMARY_OPT, ON_SECONDARY_OPT, SUBMIT_OPT], "[-s|-p|-n NODE|-I NAME] ", "Replaces all disks for the instance"), 'modify': ( SetInstanceParams, ARGS_ONE_INSTANCE, - [BACKEND_OPT, DEBUG_OPT, DISK_OPT, FORCE_OPT, HVOPTS_OPT, - NET_OPT, SUBMIT_OPT], + [BACKEND_OPT, DISK_OPT, FORCE_OPT, HVOPTS_OPT, NET_OPT, SUBMIT_OPT], "", "Alters the parameters of an instance"), 'shutdown': ( ShutdownInstance, [ArgInstance(min=1)], - [DEBUG_OPT, m_node_opt, m_pri_node_opt, m_sec_node_opt, m_clust_opt, + [m_node_opt, m_pri_node_opt, m_sec_node_opt, m_clust_opt, m_inst_opt, m_force_multi, SUBMIT_OPT], "", "Stops an instance"), 'startup': ( StartupInstance, [ArgInstance(min=1)], - [DEBUG_OPT, FORCE_OPT, m_force_multi, m_node_opt, m_pri_node_opt, + [FORCE_OPT, m_force_multi, m_node_opt, m_pri_node_opt, m_sec_node_opt, m_clust_opt, m_inst_opt, SUBMIT_OPT, HVOPTS_OPT, BACKEND_OPT], "", "Starts an instance"), 'reboot': ( RebootInstance, [ArgInstance(min=1)], - [DEBUG_OPT, m_force_multi, REBOOT_TYPE_OPT, IGNORE_SECONDARIES_OPT, - m_node_opt, m_pri_node_opt, m_sec_node_opt, m_clust_opt, m_inst_opt, - SUBMIT_OPT], + [m_force_multi, REBOOT_TYPE_OPT, IGNORE_SECONDARIES_OPT, m_node_opt, + m_pri_node_opt, m_sec_node_opt, m_clust_opt, m_inst_opt, SUBMIT_OPT], "", "Reboots an instance"), 'activate-disks': ( - ActivateDisks, ARGS_ONE_INSTANCE, - [DEBUG_OPT, SUBMIT_OPT, IGNORE_SIZE_OPT], + ActivateDisks, ARGS_ONE_INSTANCE, [SUBMIT_OPT, IGNORE_SIZE_OPT], "", "Activate an instance's disks"), 'deactivate-disks': ( - DeactivateDisks, ARGS_ONE_INSTANCE, - [DEBUG_OPT, SUBMIT_OPT], + DeactivateDisks, ARGS_ONE_INSTANCE, [SUBMIT_OPT], "", "Deactivate an instance's disks"), 'recreate-disks': ( - RecreateDisks, ARGS_ONE_INSTANCE, - [DEBUG_OPT, SUBMIT_OPT, DISKIDX_OPT], + RecreateDisks, ARGS_ONE_INSTANCE, [SUBMIT_OPT, DISKIDX_OPT], "", "Recreate an instance's disks"), 'grow-disk': ( GrowDisk, [ArgInstance(min=1, max=1), ArgUnknown(min=1, max=1), ArgUnknown(min=1, max=1)], - [DEBUG_OPT, SUBMIT_OPT, NWSYNC_OPT], + [SUBMIT_OPT, NWSYNC_OPT], " ", "Grow an instance's disk"), 'list-tags': ( - ListTags, ARGS_ONE_INSTANCE, [DEBUG_OPT], + ListTags, ARGS_ONE_INSTANCE, [], "", "List the tags of the given instance"), 'add-tags': ( AddTags, [ArgInstance(min=1, max=1), ArgUnknown()], - [DEBUG_OPT, TAG_SRC_OPT], + [TAG_SRC_OPT], " tag...", "Add tags to the given instance"), 'remove-tags': ( RemoveTags, [ArgInstance(min=1, max=1), ArgUnknown()], - [DEBUG_OPT, TAG_SRC_OPT], + [TAG_SRC_OPT], " tag...", "Remove tags from given instance"), } diff --git a/scripts/gnt-job b/scripts/gnt-job index 84de3ae..80def4b 100755 --- a/scripts/gnt-job +++ b/scripts/gnt-job @@ -345,7 +345,7 @@ def WatchJob(opts, args): commands = { 'list': ( ListJobs, [ArgJobId()], - [DEBUG_OPT, NOHDR_OPT, SEP_OPT, FIELDS_OPT], + [NOHDR_OPT, SEP_OPT, FIELDS_OPT], "[job_id ...]", "List the jobs and their status. The available fields are" " (see the man page for details): id, status, op_list," @@ -353,22 +353,22 @@ commands = { " The default field" " list is (in order): %s." % ", ".join(_LIST_DEF_FIELDS)), 'archive': ( - ArchiveJobs, [ArgJobId(min=1)], [DEBUG_OPT], + ArchiveJobs, [ArgJobId(min=1)], [], " [ ...]", "Archive specified jobs"), 'autoarchive': ( AutoArchiveJobs, [ArgSuggest(min=1, max=1, choices=["1d", "1w", "4w"])], - [DEBUG_OPT], + [], "", "Auto archive jobs older than the given age"), 'cancel': ( - CancelJobs, [ArgJobId(min=1)], [DEBUG_OPT], + CancelJobs, [ArgJobId(min=1)], [], " [ ...]", "Cancel specified jobs"), 'info': ( - ShowJobs, [ArgJobId(min=1)], [DEBUG_OPT], + ShowJobs, [ArgJobId(min=1)], [], " [ ...]", "Show detailed information about the specified jobs"), 'watch': ( - WatchJob, [ArgJobId(min=1, max=1)], [DEBUG_OPT], + WatchJob, [ArgJobId(min=1, max=1)], [], "", "Follows a job and prints its output as it arrives"), } diff --git a/scripts/gnt-node b/scripts/gnt-node index 2c18bea..3f1bc9e 100755 --- a/scripts/gnt-node +++ b/scripts/gnt-node @@ -624,84 +624,77 @@ def SetNodeParams(opts, args): commands = { 'add': ( AddNode, [ArgHost(min=1, max=1)], - [DEBUG_OPT, SECONDARY_IP_OPT, READD_OPT, NOSSH_KEYCHECK_OPT], + [SECONDARY_IP_OPT, READD_OPT, NOSSH_KEYCHECK_OPT], "[-s ip] [--readd] [--no-ssh-key-check] ", "Add a node to the cluster"), 'evacuate': ( EvacuateNode, ARGS_ONE_NODE, - [DEBUG_OPT, FORCE_OPT, IALLOCATOR_OPT, NEW_SECONDARY_OPT], + [FORCE_OPT, IALLOCATOR_OPT, NEW_SECONDARY_OPT], "[-f] {-I | -n } ", "Relocate the secondary instances from a node" " to other nodes (only for instances with drbd disk template)"), 'failover': ( - FailoverNode, ARGS_ONE_NODE, - [DEBUG_OPT, FORCE_OPT, IGNORE_CONSIST_OPT], + FailoverNode, ARGS_ONE_NODE, [FORCE_OPT, IGNORE_CONSIST_OPT], "[-f] ", "Stops the primary instances on a node and start them on their" " secondary node (only for instances with drbd disk template)"), 'migrate': ( - MigrateNode, ARGS_ONE_NODE, - [DEBUG_OPT, FORCE_OPT, NONLIVE_OPT], + MigrateNode, ARGS_ONE_NODE, [FORCE_OPT, NONLIVE_OPT], "[-f] ", "Migrate all the primary instance on a node away from it" " (only for instances of type drbd)"), 'info': ( - ShowNodeConfig, ARGS_MANY_NODES, [DEBUG_OPT], + ShowNodeConfig, ARGS_MANY_NODES, [], "[...]", "Show information about the node(s)"), 'list': ( ListNodes, ARGS_MANY_NODES, - [DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, SYNC_OPT], + [NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, SYNC_OPT], "[nodes...]", "Lists the nodes in the cluster. The available fields are (see the man" " page for details): %s. The default field list is (in order): %s." % (", ".join(_LIST_HEADERS), ", ".join(_LIST_DEF_FIELDS))), 'modify': ( SetNodeParams, ARGS_ONE_NODE, - [DEBUG_OPT, FORCE_OPT, SUBMIT_OPT, MC_OPT, DRAINED_OPT, OFFLINE_OPT], + [FORCE_OPT, SUBMIT_OPT, MC_OPT, DRAINED_OPT, OFFLINE_OPT], "", "Alters the parameters of a node"), 'powercycle': ( PowercycleNode, ARGS_ONE_NODE, - [DEBUG_OPT, FORCE_OPT, CONFIRM_OPT], + [FORCE_OPT, CONFIRM_OPT], "", "Tries to forcefully powercycle a node"), 'remove': ( - RemoveNode, ARGS_ONE_NODE, [DEBUG_OPT], + RemoveNode, ARGS_ONE_NODE, [], "", "Removes a node from the cluster"), 'volumes': ( ListVolumes, [ArgNode()], - [DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT], + [NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT], "[...]", "List logical volumes on node(s)"), 'physical-volumes': ( ListPhysicalVolumes, ARGS_MANY_NODES, - [DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, - FIELDS_OPT, _STORAGE_TYPE_OPT], - "[...]", - "List physical volumes on node(s)"), + [NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, _STORAGE_TYPE_OPT], + "[...]", "List physical volumes on node(s)"), 'modify-volume': ( ModifyVolume, [ArgNode(min=1, max=1), ArgChoice(min=1, max=1, choices=_MODIFIABLE_STORAGE_TYPES), ArgFile(min=1, max=1)], - [DEBUG_OPT, ALLOCATABLE_OPT], - " ", - "Modify storage volume on a node"), + [], + " ", "Modify storage volume on a node"), 'repair-volume': ( RepairVolume, [ArgNode(min=1, max=1), ArgChoice(min=1, max=1, choices=_REPAIRABLE_STORAGE_TYPES), ArgFile(min=1, max=1)], - [DEBUG_OPT], + [], " ", "Repairs a storage volume on a node"), 'list-tags': ( - ListTags, ARGS_ONE_NODE, [DEBUG_OPT], + ListTags, ARGS_ONE_NODE, [], "", "List the tags of the given node"), 'add-tags': ( - AddTags, [ArgNode(min=1, max=1), ArgUnknown()], - [DEBUG_OPT, TAG_SRC_OPT], + AddTags, [ArgNode(min=1, max=1), ArgUnknown()], [TAG_SRC_OPT], " tag...", "Add tags to the given node"), 'remove-tags': ( - RemoveTags, [ArgNode(min=1, max=1), ArgUnknown()], - [DEBUG_OPT, TAG_SRC_OPT], + RemoveTags, [ArgNode(min=1, max=1), ArgUnknown()], [TAG_SRC_OPT], " tag...", "Remove tags from the given node"), } diff --git a/scripts/gnt-os b/scripts/gnt-os index 4d566b1..df68165 100755 --- a/scripts/gnt-os +++ b/scripts/gnt-os @@ -146,10 +146,9 @@ def DiagnoseOS(opts, args): commands = { 'list': ( - ListOS, ARGS_NONE, [DEBUG_OPT, NOHDR_OPT], - "", "Lists all valid OSes on the master"), + ListOS, ARGS_NONE, [NOHDR_OPT], "", "Lists all valid OSes on the master"), 'diagnose': ( - DiagnoseOS, ARGS_NONE, [DEBUG_OPT], "", "Diagnose all OSes"), + DiagnoseOS, ARGS_NONE, [], "", "Diagnose all OSes"), } if __name__ == '__main__': -- 1.7.10.4