From 348cef70b90df439301b05e981f8912c0822ecdd Mon Sep 17 00:00:00 2001 From: Nicolas Simonds Date: Tue, 29 Apr 2014 11:45:37 -0700 Subject: [PATCH] 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 --- glance/registry/client/v1/api.py | 2 +- glance/registry/client/v2/api.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/glance/registry/client/v1/api.py b/glance/registry/client/v1/api.py index 21ad154a69..347c970dc1 100644 --- a/glance/registry/client/v1/api.py +++ b/glance/registry/client/v1/api.py @@ -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, } diff --git a/glance/registry/client/v2/api.py b/glance/registry/client/v2/api.py index 9d3854fd49..69b136af7a 100644 --- a/glance/registry/client/v2/api.py +++ b/glance/registry/client/v2/api.py @@ -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, }