Skip to content

Commit a517b1e

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Fix 'openstack --help' fails if clouds.yaml cannot be read"
2 parents da3d652 + e5b8e08 commit a517b1e

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

openstackclient/shell.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,17 @@ def initialize_app(self, argv):
234234
# Do configuration file handling
235235
# Ignore the default value of interface. Only if it is set later
236236
# will it be used.
237-
cc = cloud_config.OpenStackConfig(
238-
override_defaults={
239-
'interface': None,
240-
'auth_type': auth_type,
237+
try:
238+
cc = cloud_config.OpenStackConfig(
239+
override_defaults={
240+
'interface': None,
241+
'auth_type': auth_type,
241242
},
242243
)
244+
except (IOError, OSError) as e:
245+
self.log.critical("Could not read clouds.yaml configuration file")
246+
self.print_help_if_requested()
247+
raise e
243248

244249
# TODO(thowe): Change cliff so the default value for debug
245250
# can be set to None.

0 commit comments

Comments
 (0)