"nova-manage flavor create" produces the wrong help

Bug #1185902 reported by Clint Byrum
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Won't Fix
Low
Unassigned

Bug Description

$ nova-manage flavor create
Creates instance types / flavors.
usage: nova-manage [-h] [--version] [--debug] [--nodebug] [--verbose]
                   [--noverbose] [--use-syslog] [--nouse-syslog]
                   [--config-file PATH] [--log-config PATH]
                   [--log-format FORMAT] [--log-date-format DATE_FORMAT]
                   [--log-file PATH] [--log-dir LOG_DIR]
                   [--syslog-log-facility SYSLOG_LOG_FACILITY]
                   [--config-dir DIR]

                   {version,bash-completion,project,account,shell,logs,service,db,vm,agent,cell,instance_type,host,flavor,fixed,vpn,floating,network}
                   ...

optional arguments:
  -h, --help show this help message and exit
  --version show program's version number and exit
  --debug, -d Print debugging output (set logging level to DEBUG
                        instead of default WARNING level).
  --nodebug The inverse of --debug
  --verbose, -v Print more verbose output (set logging level to INFO
                        instead of default WARNING level).
  --noverbose The inverse of --verbose
  --use-syslog Use syslog for logging.
  --nouse-syslog The inverse of --use-syslog
  --config-file PATH Path to a config file to use. Multiple config files
                        can be specified, with values in later files taking
                        precedence. The default files used are:
                        ['/etc/nova/nova.conf']
  --log-config PATH If this option is specified, the logging configuration
                        file specified is used and overrides any other logging
                        options specified. Please see the Python logging
                        module documentation for details on logging
                        configuration files.
  --log-format FORMAT A logging.Formatter log message format string which
                        may use any of the available logging.LogRecord
                        attributes. This option is deprecated. Please use
                        logging_context_format_string and
                        logging_default_format_string instead.
  --log-date-format DATE_FORMAT
                        Format string for %(asctime)s in log records. Default:
                        None
  --log-file PATH, --logfile PATH
                        (Optional) Name of log file to output to. If no
                        default is set, logging will go to stdout.
  --log-dir LOG_DIR, --logdir LOG_DIR
                        (Optional) The base directory used for relative --log-
                        file paths
  --syslog-log-facility SYSLOG_LOG_FACILITY
                        syslog facility to receive log lines
  --config-dir DIR Path to a config directory to pull *.conf files from.
                        This file set is sorted, so as to provide a
                        predictable parse order if individual options are
                        over-ridden. The set is parsed after the file(s), if
                        any, specified via --config-file, hence over-ridden
                        options in the directory take precedence.

Command categories:
  {version,bash-completion,project,account,shell,logs,service,db,vm,agent,cell,instance_type,host,flavor,fixed,vpn,floating,network}
                        Available categories
4 arguments are missing
$

This does not help me much. I need the help for 'flavor create', like when I do --help:

$ nova-manage flavor create --help
usage: nova-manage flavor create [-h] [--name <name>] [--memory <memory size>]
                                 [--cpu <num cores>] [--root_gb <root_gb>]
                                 [--ephemeral_gb <ephemeral_gb>]
                                 [--flavor <flavor id>] [--swap <swap>]
                                 [--rxtx_factor <rxtx_factor>]
                                 [--is_public <is_public>]
                                 [action_args [action_args ...]]

positional arguments:
  action_args

optional arguments:
  -h, --help show this help message and exit
  --name <name> Name of instance type/flavor
  --memory <memory size>
                        Memory size
  --cpu <num cores> Number cpus
  --root_gb <root_gb> Root disk size
  --ephemeral_gb <ephemeral_gb>
                        Ephemeral disk size
  --flavor <flavor id>
                        Flavor ID
  --swap <swap> Swap
  --rxtx_factor <rxtx_factor>
                        rxtx_factor
  --is_public <is_public>
                        Make flavor accessible to the public
$

Tags: nova-manage
tags: added: nova-manage
Revision history for this message
Yang Hongyang (hongyang-yang) wrote :

We should use required option of argparser instead of manually check action arguments using cliutils.validate_args(). cliutils.validate_args() only checks arguments count. By using required option of argparser, the useage message outputed will be more helpful.

I will make a patch to remove cliutils module and fix this bug.

Changed in nova:
status: New → In Progress
assignee: nobody → Yang Hongyang (imhy-yang)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/31762

Revision history for this message
Yang Hongyang (hongyang-yang) wrote :

Use required option of argparse will cause level down, not using this approach.

Print action help message to workaround this problem.

Revision history for this message
Matt Riedemann (mriedem) wrote :

The patch was abandoned. nova-manage flavor commands are deprecated in Juno and will be removed in the K release, so keep that in mind. Leaving this as Triaged for now since the related patch did appear to be doing more than just trying to help with the flavor command help.

Changed in nova:
status: In Progress → Triaged
importance: Undecided → Low
assignee: Yang Hongyang (imhy-yang) → nobody
Joe Gordon (jogo)
Changed in nova:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.