Generate auth plugin options based on the name

When loading the auth plugin options, the conversion from "-" into "_"
is done based on the "dest" attribute of the option, instead of using
its name. This makes that if a plugin defines an option with a different
destination the wrong option will be created in osc, therefore the
option won't be passed properly to the plugin class.

Backported from OSC Iac7346dd57f8ea4f5b956b9bdf9f70d9494b63f8
(https://review.openstack.org/#/c/335003/)

Co-Authored-By: Alvaro Lopez Garcia <aloga@ifca.unican.es>
Closes-Bug: #1596937
Change-Id: Iab84c918f82d0313d2562ebc0655bf11d24175c9
This commit is contained in:
Dean Troyer 2016-07-07 16:24:03 -05:00
parent 7a5987cacf
commit abc824010a
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ def get_options_list():
for plugin_name in get_plugin_list():
plugin_options = base.get_plugin_options(plugin_name)
for o in plugin_options:
os_name = o.dest.lower().replace('_', '-')
os_name = o.name.lower().replace('_', '-')
os_env_name = 'OS_' + os_name.upper().replace('-', '_')
OPTIONS_LIST.setdefault(
os_name, {'env': os_env_name, 'help': ''},