Fix 'openstack --help' fails if clouds.yaml cannot be read
'openstack --help' can display the basic information, even if openstack command does not have permission to read clouds.yaml. Change-Id: I7d5255c5ce3bd60af77fc70f433ca78dc011a79f Closes-Bug: #1541047
This commit is contained in:
parent
73cabcc871
commit
e5b8e08eb1
@ -234,12 +234,17 @@ class OpenStackShell(app.App):
|
|||||||
# Do configuration file handling
|
# Do configuration file handling
|
||||||
# Ignore the default value of interface. Only if it is set later
|
# Ignore the default value of interface. Only if it is set later
|
||||||
# will it be used.
|
# will it be used.
|
||||||
cc = cloud_config.OpenStackConfig(
|
try:
|
||||||
override_defaults={
|
cc = cloud_config.OpenStackConfig(
|
||||||
'interface': None,
|
override_defaults={
|
||||||
'auth_type': auth_type,
|
'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
|
# TODO(thowe): Change cliff so the default value for debug
|
||||||
# can be set to None.
|
# can be set to None.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user