diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-06-21 15:37:45 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-06-21 15:37:45 +0000 |
| commit | a60f16b9385d7ee2322a25b5728363fbf8f5154b (patch) | |
| tree | 1859d5cb049bb34af162e2b5f24d53ef966ea56f /openstackclient/api | |
| parent | b86915aa7e2152b746d2c71c81b4c67a0ba9490e (diff) | |
| parent | 099a2c38b99dff6a0909c0a3ba2909f1aea58644 (diff) | |
| download | python-openstackclient-a60f16b9385d7ee2322a25b5728363fbf8f5154b.tar.gz | |
Merge "Refactor setting defaults for some scope parameters"
Diffstat (limited to 'openstackclient/api')
| -rw-r--r-- | openstackclient/api/auth.py | 5 | ||||
| -rw-r--r-- | openstackclient/api/auth_plugin.py | 2 |
2 files changed, 5 insertions, 2 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) diff --git a/openstackclient/api/auth_plugin.py b/openstackclient/api/auth_plugin.py index 36dc5160..4434bc8f 100644 --- a/openstackclient/api/auth_plugin.py +++ b/openstackclient/api/auth_plugin.py @@ -38,7 +38,7 @@ class TokenEndpoint(token_endpoint.AdminToken): is for bootstrapping the Keystone database. """ - def load_from_options(self, url, token): + def load_from_options(self, url, token, **kwargs): """A plugin for static authentication with an existing token :param string url: Service endpoint |
