summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2014-09-28 11:49:13 -0700
committerMonty Taylor <mordred@inaugust.com>2014-10-10 15:25:53 -0700
commit215425f421cb4b831f1a294d73a25a14f301c1f4 (patch)
treeffc753a60ba0372a4675cc2e41cef73a8fbcf849
parent67f1fbd22ed5d0558a92c49c5114a292d1f0cc01 (diff)
downloados-client-config-215425f421cb4b831f1a294d73a25a14f301c1f4.tar.gz
Handle no vendor clouds config files
Change-Id: If0ab1db3df8ba3a2880473f2287ae3f85c84d9d5
-rw-r--r--os_client_config/config.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/os_client_config/config.py b/os_client_config/config.py
index 8cdb06c..ade9708 100644
--- a/os_client_config/config.py
+++ b/os_client_config/config.py
@@ -105,12 +105,13 @@ class OpenStackConfig(object):
# yes, I know the next line looks silly
if 'cloud' in our_cloud:
+ cloud_name = our_cloud['cloud']
vendor_file = self._load_vendor_file()
- if our_cloud['cloud'] in vendor_file['public-clouds']:
- cloud.update(vendor_file['public-clouds'][our_cloud['cloud']])
+ if vendor_file and cloud_name in vendor_file['public-clouds']:
+ cloud.update(vendor_file['public-clouds'][cloud_name])
else:
try:
- cloud.update(vendors.CLOUD_DEFAULTS[our_cloud['cloud']])
+ cloud.update(vendors.CLOUD_DEFAULTS[cloud_name])
except KeyError:
# Can't find the requested vendor config, go about business
pass