Comment 0 for bug 1837199

Revision history for this message
Attila Fazekas (afazekas) wrote :

# nova-manage cell_v2
An error has occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/oslo_config/cfg.py", line 3179, in __getattr__
    return getattr(self._conf._namespace, name)
AttributeError: '_Namespace' object has no attribute 'action_fn'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/stack/nova/nova/cmd/manage.py", line 2205, in main
    fn, fn_args, fn_kwargs = cmd_common.get_action_fn()
  File "/opt/stack/nova/nova/cmd/common.py", line 169, in get_action_fn
    fn = CONF.category.action_fn
  File "/usr/local/lib/python3.7/site-packages/oslo_config/cfg.py", line 3181, in __getattr__
    raise NoSuchOptError(name)
oslo_config.cfg.NoSuchOptError: no such option action_fn in group [DEFAULT]

# nova-manage cell_v2 help
usage: nova-manage cell_v2 [-h]
                           {create_cell,delete_cell,delete_host,discover_hosts,list_cells,list_hosts,map_cell0,map_cell_and_hosts,map_instances,simple_cell_setup,update_cell,verify_instance}
                           ...
nova-manage cell_v2: error: argument action: invalid choice: 'help' (choose from 'create_cell', 'delete_cell', 'delete_host', 'discover_hosts', 'list_cells', 'list_hosts', 'map_cell0', 'map_cell_and_hosts', 'map_instances', 'simple_cell_setup', 'update_cell', 'verify_instance')

# nova-manage cell_v2 -h
usage: nova-manage cell_v2 [-h]
                           {create_cell,delete_cell,delete_host,discover_hosts,list_cells,list_hosts,map_cell0,map_cell_and_hosts,map_instances,simple_cell_setup,update_cell,verify_instance}
                           ...

positional arguments:
  {create_cell,delete_cell,delete_host,discover_hosts,list_cells,list_hosts,map_cell0,map_cell_and_hosts,map_instances,simple_cell_setup,update_cell,verify_instance}

optional arguments:
  -h, --help show this help message and exit

python version:
/usr/bin/python3 --version
Python 3.7.3

nova version:
$ git log -1
commit 78f9961d293e3b3e0ac62345b78abb1c9e2bd128 (HEAD -> master, origin/master, origin/HEAD)

Instead of printing Traceback, nova-manage should give a hint for the user choices.