summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDean Troyer <dtroyer@gmail.com>2014-09-21 20:44:44 -0500
committerDean Troyer <dtroyer@gmail.com>2014-09-21 21:03:18 -0500
commitb8382c349687b09e15f92cde9d0099fea5252657 (patch)
tree035ac9c67cf6f33e147ea41bae7c5817a4eaa3b2
parent1277d4cfc58a0c4e7338e29ada0df9631d62da21 (diff)
downloados-client-config-b8382c349687b09e15f92cde9d0099fea5252657.tar.gz
Make env vars lowest priority
When working with multiple tools the project CLIs only know about options and environment variables. When selecting a cloud config that includes a section from vendors.py environment vars overwrite that data if they are defined. The priority order should be: * command line args * cloud config selection * environment variables
-rw-r--r--os_client_config/config.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/os_client_config/config.py b/os_client_config/config.py
index 5cc8edd..64eaff7 100644
--- a/os_client_config/config.py
+++ b/os_client_config/config.py
@@ -90,11 +90,13 @@ class OpenStackConfig(object):
else:
our_cloud = dict()
+ # Get the defaults (including env vars) first
+ cloud.update(self.defaults)
+
# yes, I know the next line looks silly
if 'cloud' in our_cloud:
cloud.update(vendors.CLOUD_DEFAULTS[our_cloud['cloud']])
- cloud.update(self.defaults)
cloud.update(our_cloud)
if 'cloud' in cloud:
del cloud['cloud']