From 7b601bdb2fcb4ff1203bfb08886f459ab00df6ee Mon Sep 17 00:00:00 2001 From: liuyamin Date: Wed, 9 Aug 2017 09:14:08 +0800 Subject: [PATCH] Unsupported 'message' Exception attribute in PY3 The 'message' attribute has been deprecated and removed from Python3. Use six.text_type(e) instead of e.message. For more details, please check [1]: [1] https://www.python.org/dev/peps/pep-0352/ Change-Id: Ibd4e7f5fefa6b1dfb6258c5eacfa53cd3485d22c --- cinderclient/client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cinderclient/client.py b/cinderclient/client.py index 6537cfe73..024dffff5 100644 --- a/cinderclient/client.py +++ b/cinderclient/client.py @@ -217,7 +217,7 @@ class SessionClient(adapter.LegacyJsonAdapter): version = get_volume_api_from_url(self.get_endpoint()) except exceptions.UnsupportedVersion as e: msg = (_("Service catalog returned invalid url.\n" - "%s") % six.text_type(e.message)) + "%s") % six.text_type(e)) raise exceptions.UnsupportedVersion(msg) return version @@ -468,10 +468,10 @@ class HTTPClient(object): if self.management_url == self.bypass_url: msg = (_("Invalid url was specified in --os-endpoint or " "environment variable CINDERCLIENT_BYPASS_URL.\n" - "%s") % six.text_type(e.message)) + "%s") % six.text_type(e)) else: msg = (_("Service catalog returned invalid url.\n" - "%s") % six.text_type(e.message)) + "%s") % six.text_type(e)) raise exceptions.UnsupportedVersion(msg)