summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2016-10-24 05:40:32 +0200
committerMonty Taylor <mordred@inaugust.com>2016-10-24 05:42:54 +0200
commitb5d65b74f60ce743b03b49a6c176700d658cfe98 (patch)
treeee54ebbb8d0f6e34f49b6245a0349c9e360ab9a7
parentdaffcbc112289eed32e4c3e6cb7c65202febfef6 (diff)
downloados-client-config-b5d65b74f60ce743b03b49a6c176700d658cfe98.tar.gz
Support token_endpoint as an auth_type
For backwards compat with what operators have been trained to do, map token_endpoint to admin_token for them. This has shown up a few times in the wild. Most recently: https://github.com/ansible/ansible-modules-core/issues/5250 Change-Id: Ie083381e7fda19e016b6425939bd3c2dc260fa9b
-rw-r--r--os_client_config/config.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/os_client_config/config.py b/os_client_config/config.py
index a0d862d..dc3decd 100644
--- a/os_client_config/config.py
+++ b/os_client_config/config.py
@@ -854,6 +854,11 @@ class OpenStackConfig(object):
# Set to notused rather than None because validate_auth will
# strip the value if it's actually python None
config['auth']['token'] = 'notused'
+ elif config['auth_type'] == 'token_endpoint':
+ # Humans have been trained to use a thing called token_endpoint
+ # That it does not exist in keystoneauth is irrelvant- it not
+ # doing what they want causes them sorrow.
+ config['auth_type'] = 'admin_token'
return loading.get_plugin_loader(config['auth_type'])
def _validate_auth_ksc(self, config, cloud):