summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-02-17 20:30:49 +0000
committerGerrit Code Review <review@openstack.org>2016-02-17 20:30:49 +0000
commita517b1e9a6bffe590ead966ed19d9314ca6b108f (patch)
tree59cd479f09f4dd077ed441e52b02615f8b579b5b /openstackclient
parentda3d65299bc168ca86bfb4055d08556715149e0f (diff)
parente5b8e08eb1322447940ced48b492fdc1e87399b2 (diff)
downloadpython-openstackclient-a517b1e9a6bffe590ead966ed19d9314ca6b108f.tar.gz
Merge "Fix 'openstack --help' fails if clouds.yaml cannot be read"
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/shell.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/openstackclient/shell.py b/openstackclient/shell.py
index c84e2b1d..137446ef 100644
--- a/openstackclient/shell.py
+++ b/openstackclient/shell.py
@@ -234,12 +234,17 @@ class OpenStackShell(app.App):
# Do configuration file handling
# Ignore the default value of interface. Only if it is set later
# will it be used.
- cc = cloud_config.OpenStackConfig(
- override_defaults={
- 'interface': None,
- 'auth_type': auth_type,
+ try:
+ cc = cloud_config.OpenStackConfig(
+ override_defaults={
+ 'interface': None,
+ 'auth_type': auth_type,
},
)
+ except (IOError, OSError) as e:
+ self.log.critical("Could not read clouds.yaml configuration file")
+ self.print_help_if_requested()
+ raise e
# TODO(thowe): Change cliff so the default value for debug
# can be set to None.