Allow $OS_AUTH_URL environment variable to override config file value

Make the Glance APIs use this value in a consistent/expected manner
when it is set.  The Principle of Least Surprise dictates that
setting the value in the environment should override any values in
the config files.

Change-Id: Icdc39a2fd0da71a75f4ad0e60e34cfb8e1883787
Closes-Bug: 1314354
This commit is contained in:
Nicolas Simonds 2014-04-29 11:45:37 -07:00
parent cc3435647d
commit 348cef70b9
2 changed files with 2 additions and 2 deletions

View File

@ -114,7 +114,7 @@ def configure_registry_admin_creds():
'password': CONF.admin_password,
'username': CONF.admin_user,
'tenant': CONF.admin_tenant_name,
'auth_url': CONF.auth_url,
'auth_url': os.getenv('OS_AUTH_URL') or CONF.auth_url,
'strategy': strategy,
'region': CONF.auth_region,
}

View File

@ -95,7 +95,7 @@ def configure_registry_admin_creds():
'password': CONF.admin_password,
'username': CONF.admin_user,
'tenant': CONF.admin_tenant_name,
'auth_url': CONF.auth_url,
'auth_url': os.getenv('OS_AUTH_URL') or CONF.auth_url,
'strategy': strategy,
'region': CONF.auth_region,
}