summaryrefslogtreecommitdiff
path: root/os_client_config
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2016-10-12 15:05:02 -0500
committerMonty Taylor <mordred@inaugust.com>2016-10-12 15:05:08 -0500
commit6623be208dc009cd1667c7d5db0b9df89ea3a80f (patch)
tree1e7e2f4eda0c52d043e1e2350ff88e8b42a358e0 /os_client_config
parent686bd837649d921b22ff9f431955e75450dfffda (diff)
downloados-client-config-6623be208dc009cd1667c7d5db0b9df89ea3a80f.tar.gz
Revert "Split auth plugin loading into its own method"
This reverts commit 8b7859e21e64027d20f158737bbf70bbe409b847. python-openstackclient has a subclass that defines this method with a different signature. Change-Id: Ie44f8efb6b93dc0d4754fb316ddb9087ce181275
Diffstat (limited to 'os_client_config')
-rw-r--r--os_client_config/config.py34
1 files changed, 15 insertions, 19 deletions
diff --git a/os_client_config/config.py b/os_client_config/config.py
index 01f659e..5ab0d90 100644
--- a/os_client_config/config.py
+++ b/os_client_config/config.py
@@ -1035,24 +1035,6 @@ class OpenStackConfig(object):
return config
- def load_auth_plugin(self, config, cloud):
- try:
- loader = self._get_auth_loader(config)
- config = self._validate_auth(config, loader)
- auth_plugin = loader.load_from_options(**config['auth'])
- except Exception as e:
- # We WANT the ksa exception normally
- # but OSC can't handle it right now, so we try deferring
- # to ksc. If that ALSO fails, it means there is likely
- # a deeper issue, so we assume the ksa error was correct
- self.log.debug("Deferring keystone exception: {e}".format(e=e))
- auth_plugin = None
- try:
- config = self._validate_auth_ksc(config, cloud)
- except Exception:
- raise e
- return auth_plugin
-
def get_one_cloud(self, cloud=None, validate=True,
argparse=None, **kwargs):
"""Retrieve a single cloud configuration and merge additional options
@@ -1111,7 +1093,21 @@ class OpenStackConfig(object):
config = self.auth_config_hook(config)
if validate:
- auth_plugin = self.load_auth_plugin(config, cloud)
+ try:
+ loader = self._get_auth_loader(config)
+ config = self._validate_auth(config, loader)
+ auth_plugin = loader.load_from_options(**config['auth'])
+ except Exception as e:
+ # We WANT the ksa exception normally
+ # but OSC can't handle it right now, so we try deferring
+ # to ksc. If that ALSO fails, it means there is likely
+ # a deeper issue, so we assume the ksa error was correct
+ self.log.debug("Deferring keystone exception: {e}".format(e=e))
+ auth_plugin = None
+ try:
+ config = self._validate_auth_ksc(config, cloud)
+ except Exception:
+ raise e
else:
auth_plugin = None