summaryrefslogtreecommitdiff
path: root/os_client_config
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2015-10-26 14:11:55 +0900
committerMonty Taylor <mordred@inaugust.com>2015-10-27 07:28:50 +0900
commit4ae04265ffc015259a2c3709b03edcfe86953833 (patch)
treefa020dc17ea2652aa7be63cea7b545786859cfc5 /os_client_config
parentf8804bd4f5f9ab5a1e83ec5decfaa8474f1258b6 (diff)
downloados-client-config-4ae04265ffc015259a2c3709b03edcfe86953833.tar.gz
Allow for templated variables in auth_url
Some clouds have auth_urls per region, which means putting a static auth_url in the config file isn't going to work. Allow {} substitutions in the auth_url so that other elements of the auth dict can be injected. This will not solve _everything, but it will solve all of the currently identified issues, and should be upwardly open if we need something more complex later. Change-Id: I6107d0669734647cfa0bef118bdf7739949991ad
Diffstat (limited to 'os_client_config')
-rw-r--r--os_client_config/config.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/os_client_config/config.py b/os_client_config/config.py
index 2e3644b..578e5cd 100644
--- a/os_client_config/config.py
+++ b/os_client_config/config.py
@@ -615,6 +615,13 @@ class OpenStackConfig(object):
if type(config[key]) is not bool:
config[key] = get_boolean(config[key])
+ # TODO(mordred): Special casing auth_url here. We should
+ # come back to this betterer later so that it's
+ # more generalized
+ if 'auth' in config and 'auth_url' in config['auth']:
+ config['auth']['auth_url'] = config['auth']['auth_url'].format(
+ **config)
+
# NOTE(dtroyer): OSC needs a hook into the auth args before the
# plugin is loaded in order to maintain backward-
# compatible behaviour