From 8a6dcc89b329c2cfe2ceffefe6147f06ab85b48c Mon Sep 17 00:00:00 2001 From: zhaoxinyu Date: Tue, 18 Mar 2014 22:36:31 +0000 Subject: [PATCH] Pass environment variables to exmaple.py Use another way to check whether to use environment variables. Use the env value even if it is None as long as the key exists so an empty role list can trigger role auto assignment. Change-Id: Ifb2993e4d71c7e58aacd39e1a4782040bbc11885 --- compass/apiclient/example.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compass/apiclient/example.py b/compass/apiclient/example.py index 990a38ed..311c2ea9 100755 --- a/compass/apiclient/example.py +++ b/compass/apiclient/example.py @@ -80,9 +80,8 @@ PRESET_VALUES = { 'MACHINES_TO_ADD': '00:11:20:30:40:01', 'BUILD_TIMEOUT': 60 } -print os.environ.get("NAMESERVERS") for v in PRESET_VALUES: - if os.environ.get(v): + if v in os.environ.keys(): PRESET_VALUES[v] = os.environ.get(v) print (v + PRESET_VALUES[v] + " is set by env variables") else: