summaryrefslogtreecommitdiff
path: root/openstackclient/api/auth.py
diff options
context:
space:
mode:
authorAlvaro Lopez Garcia <aloga@ifca.unican.es>2016-05-27 11:03:15 +0200
committerAlvaro Lopez Garcia <aloga@ifca.unican.es>2016-06-21 08:55:30 +0200
commit099a2c38b99dff6a0909c0a3ba2909f1aea58644 (patch)
tree33a22440e3e8f3917b9023f557e1271fcbcd0807 /openstackclient/api/auth.py
parent78ae57112c846b3a230a928fe5fc3d8ee909dc15 (diff)
downloadpython-openstackclient-099a2c38b99dff6a0909c0a3ba2909f1aea58644.tar.gz
Refactor setting defaults for some scope parameters
The code is setting defaults for some scope parameters, cheking if the name ends with some specific substring (namely ending in "password") causing failures in some plugins that end with the same string, but do not allow those parameters (like "user_domain_id" in "v3oidcpassword"). Closes-Bug: #1582774 Change-Id: Id7036db3b783b135353d035dc4c1df7c808d6474
Diffstat (limited to 'openstackclient/api/auth.py')
-rw-r--r--openstackclient/api/auth.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/openstackclient/api/auth.py b/openstackclient/api/auth.py
index 9981f6d5..d5412594 100644
--- a/openstackclient/api/auth.py
+++ b/openstackclient/api/auth.py
@@ -105,10 +105,12 @@ def select_auth_plugin(options):
def build_auth_params(auth_plugin_name, cmd_options):
- auth_params = dict(cmd_options.auth)
if auth_plugin_name:
LOG.debug('auth_type: %s', auth_plugin_name)
auth_plugin_loader = base.get_plugin_loader(auth_plugin_name)
+ auth_params = {opt.dest: opt.default
+ for opt in base.get_plugin_options(auth_plugin_name)}
+ auth_params.update(dict(cmd_options.auth))
# grab tenant from project for v2.0 API compatibility
if auth_plugin_name.startswith("v2"):
if 'project_id' in auth_params:
@@ -121,6 +123,7 @@ def build_auth_params(auth_plugin_name, cmd_options):
LOG.debug('no auth_type')
# delay the plugin choice, grab every option
auth_plugin_loader = None
+ auth_params = dict(cmd_options.auth)
plugin_options = set([o.replace('-', '_') for o in get_options_list()])
for option in plugin_options:
LOG.debug('fetching option %s', option)