summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Shrewsbury <shrewsbury.dave@gmail.com>2015-08-12 19:56:51 +0000
committerDavid Shrewsbury <shrewsbury.dave@gmail.com>2015-08-12 19:56:51 +0000
commit13a04f76b9f13ec89a9d0aa8a7e9b064e8fa98b4 (patch)
tree8360ff5b9c5ec85c1a36d3dee1a077603f09db63
parenta8e8c809eeec0f09b5d9207c29efb3c6a1f9c088 (diff)
downloados-client-config-13a04f76b9f13ec89a9d0aa8a7e9b064e8fa98b4.tar.gz
Ignore infra CI env vars
When running tests in the infra CI system, some OS_ environment variables are defined (e.g., OS_TEST_TIMEOUT, OS_TEST_PATH, OS_STDERR_CAPTURE, OS_STDOUT_CAPTURE) and this makes o-c-c think that we are using environment variables for an envvar cloud. In some rare cases, this can cause tests to fail if they expect cloud definitions to come only from clouds.yaml. This change ignores these CI variables. Change-Id: I6458969b45f5534e1172b9f8ba598d7c536a59b5
-rw-r--r--os_client_config/config.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/os_client_config/config.py b/os_client_config/config.py
index 1840d18..7c65b53 100644
--- a/os_client_config/config.py
+++ b/os_client_config/config.py
@@ -82,7 +82,11 @@ def get_boolean(value):
def _get_os_environ():
ret = defaults.get_defaults()
- environkeys = [k for k in os.environ.keys() if k.startswith('OS_')]
+ environkeys = [k for k in os.environ.keys()
+ if k.startswith('OS_')
+ and not k.startswith('OS_TEST') # infra CI var
+ and not k.startswith('OS_STD') # infra CI var
+ ]
if not environkeys:
return None
for k in environkeys: