diff options
| author | Dean Troyer <dtroyer@gmail.com> | 2014-10-22 11:12:47 -0500 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2014-10-23 15:37:44 -0500 |
| commit | f079b5b9c4c030293b4ebfdf84d8b768b3aa3515 (patch) | |
| tree | 35f2c235fcc3aabcda4700329c1bd878576c7198 /openstackclient/common/clientmanager.py | |
| parent | e063246b97a7f31a47aca0a5eb36d571f5df7236 (diff) | |
| download | python-openstackclient-f079b5b9c4c030293b4ebfdf84d8b768b3aa3515.tar.gz | |
Change --os-auth-plugin to --os-auth-type
User's don't know what a plugin is.
* Internally, os_auth_type and/or auth_type represents what the
user supplied.
* auth_plugin_name is the name of the selected plugin
* auth_plugin is the actual plugin object
Plugin selection process:
* if --os-auth-type is supplied:
* if it matches against an available plugin, done
* (if it can map to an availble plugin type, done; TODO in a followup)
* if --os-auth-type is not supplied:
* if --os-url and --os-token are supplied, select 'token_endpoint'
* if --os-username supplied, select identity_api_version + 'password'
* if --os-token supplied, select identity_api_version + 'token'
Change-Id: Ice4535214e311ebf924087cf77f6d84d76f5f3ee
Diffstat (limited to 'openstackclient/common/clientmanager.py')
| -rw-r--r-- | openstackclient/common/clientmanager.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/openstackclient/common/clientmanager.py b/openstackclient/common/clientmanager.py index ae38f160..adec842f 100644 --- a/openstackclient/common/clientmanager.py +++ b/openstackclient/common/clientmanager.py @@ -19,7 +19,6 @@ import logging import pkg_resources import sys -from keystoneclient.auth import base from keystoneclient import session import requests @@ -78,20 +77,22 @@ class ClientManager(object): returns a string containig the password """ - # If no plugin is named by the user, select one based on + # If no auth type is named by the user, select one based on # the supplied options - if not auth_options.os_auth_plugin: - auth_options.os_auth_plugin = auth.select_auth_plugin(auth_options) - self._auth_plugin = auth_options.os_auth_plugin + self.auth_plugin_name = auth.select_auth_plugin(auth_options) # Horrible hack alert...must handle prompt for null password if # password auth is requested. - if (self._auth_plugin.endswith('password') and + if (self.auth_plugin_name.endswith('password') and not auth_options.os_password): auth_options.os_password = pw_func() + (auth_plugin, self._auth_params) = auth.build_auth_params( + self.auth_plugin_name, + auth_options, + ) + self._url = auth_options.os_url - self._auth_params = auth.build_auth_params(auth_options) self._region_name = auth_options.os_region_name self._api_version = api_version self._auth_ref = None @@ -117,8 +118,7 @@ class ClientManager(object): root_logger = logging.getLogger('') LOG.setLevel(root_logger.getEffectiveLevel()) - LOG.debug('Using auth plugin: %s' % self._auth_plugin) - auth_plugin = base.get_plugin_class(self._auth_plugin) + LOG.debug('Using auth plugin: %s' % self.auth_plugin_name) self.auth = auth_plugin.load_from_options(**self._auth_params) # needed by SAML authentication request_session = requests.session() |
