summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHongbin Lu <hongbin.lu@huawei.com>2017-11-14 23:24:55 +0000
committerHongbin Lu <hongbin.lu@huawei.com>2017-11-14 23:25:52 +0000
commit8b31e2bc4843f76b659a644406c0a522bf29b612 (patch)
tree37eb377d098a9d1017544167e4fd617fe985a73e
parent4742d4df7089cd10d03635a1b3dbca9e7e80b1cc (diff)
downloadpython-openstackclient-8b31e2bc4843f76b659a644406c0a522bf29b612.tar.gz
Show detailed message of neutron exception
This patch improves the error message by retrieving the more details from the exception instance. Otherwise, the real error message won't be displayed (unless using --debug in the command). Change-Id: I8ba694bda86f7cc8362e301b2044d9b610dde49c
-rw-r--r--openstackclient/network/common.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/openstackclient/network/common.py b/openstackclient/network/common.py
index a2e700be..eca0de3c 100644
--- a/openstackclient/network/common.py
+++ b/openstackclient/network/common.py
@@ -191,6 +191,8 @@ class NetworkAndComputeShowOne(command.ShowOne):
self.app.client_manager.compute, parsed_args)
except openstack.exceptions.HttpException as exc:
msg = _("Error while executing command: %s") % exc.message
+ if exc.details:
+ msg += ", " + six.text_type(exc.details)
raise exceptions.CommandError(msg)
def get_parser(self, prog_name):