When executing 'cinder-manage cluster remove' script, an error occurs in
the call 'fetch_func_args(fn)':
oslo_config.cfg.NoSuchOptError:no such option cluster_name in group
[DEFAULT].
The cause is that the call 'fetch_func_args(fn)' is trying to fetch
value of argument 'cluster_name' of fn from CONF.cluster_name, but
corresponding argument registered in CONF is 'cluster-name' actually.
We fix this bug by changing argument name registered in CONF, if
positional argument contains '-':
1.put it into automatic conversion from '- to '_', so that keep it the
same name as handler function argument.
2.add metavar if it doesn't already exist, and it will maintain the help
output.
Reviewed: https:/ /review. opendev. org/750077 /git.openstack. org/cgit/ openstack/ cinder/ commit/ ?id=50a4592efb3 9902b994470a229 dff7b37810727b
Committed: https:/
Submitter: Zuul
Branch: master
commit 50a4592efb39902 b994470a229dff7 b37810727b
Author: czl389 <czl389@163.com>
Date: Sun Sep 6 00:48:32 2020 +0800
Fix cinder-manage cluster remove raising NoSuchOptError
When executing 'cinder-manage cluster remove' script, an error occurs in func_args( fn)': config. cfg.NoSuchOptEr ror:no such option cluster_name in group
the call 'fetch_
oslo_
[DEFAULT].
The cause is that the call 'fetch_ func_args( fn)' is trying to fetch
value of argument 'cluster_name' of fn from CONF.cluster_name, but
corresponding argument registered in CONF is 'cluster-name' actually.
We fix this bug by changing argument name registered in CONF, if
positional argument contains '-':
1.put it into automatic conversion from '- to '_', so that keep it the
same name as handler function argument.
2.add metavar if it doesn't already exist, and it will maintain the help
output.
Change-Id: I3f2a04b4c8e7ba fe6e38fc86a6919 2dd3a94c0c5
Closes-Bug: #1894381