commit 48f9b1c2ce798dc4a7f6b7b54dfaf38760d3a730
Author: Matt Riedemann <email address hidden>
Date: Mon Nov 18 11:36:20 2019 -0500
Print help if nova-manage subcommand is not specified
If a nova-manage command is executed without the -h option
or a subcommand the user gets an ugly traceback. This is
easily recreated:
$ tox -e venv -- nova-manage db
Make the action argument required, so we get a helpful error message
instead.
$ nova-manage db
usage: nova-manage db [-h] {archive_deleted_rows,ironic_flavor_migration, null_instance_uuid_scan,online_data_migrations, purge,sync,version} ...
nova-manage db: error: the following arguments are required: action
Note that unit tests appear to be impossible for this, since doing so
attempts to initialize an oslo.config 'CONF' singleton and this is
something we've already done in 'nova.test' and can't do again.
Change-Id: I24d03eed3aa3b882c49916938f4c25d76fd4e831
Closes-Bug: #1837199
Co-Authored-By: Stephen Finucane <email address hidden>
(cherry picked from commit 51b0d4ca58f70fdd887dd053bfae1b2c918c33ba)
Reviewed: https:/ /review. opendev. org/702637 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=48f9b1c2ce7 98dc4a7f6b7b54d faf38760d3a730
Committed: https:/
Submitter: Zuul
Branch: stable/train
commit 48f9b1c2ce798dc 4a7f6b7b54dfaf3 8760d3a730
Author: Matt Riedemann <email address hidden>
Date: Mon Nov 18 11:36:20 2019 -0500
Print help if nova-manage subcommand is not specified
If a nova-manage command is executed without the -h option
or a subcommand the user gets an ugly traceback. This is
easily recreated:
$ tox -e venv -- nova-manage db
Make the action argument required, so we get a helpful error message
instead.
$ nova-manage db
{archive_ deleted_ rows,ironic_ flavor_ migration,
null_ instance_ uuid_scan, online_ data_migrations ,
purge, sync,version}
.. .
usage: nova-manage db [-h]
nova-manage db: error: the following arguments are required: action
Note that unit tests appear to be impossible for this, since doing so
attempts to initialize an oslo.config 'CONF' singleton and this is
something we've already done in 'nova.test' and can't do again.
Change-Id: I24d03eed3aa3b8 82c49916938f4c2 5d76fd4e831 d887dd053bfae1b 2c918c33ba)
Closes-Bug: #1837199
Co-Authored-By: Stephen Finucane <email address hidden>
(cherry picked from commit 51b0d4ca58f70fd