summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorricolin <rico.lin@easystack.cn>2017-07-17 15:14:50 +0800
committerRico Lin <rico.lin@easystack.cn>2017-07-27 01:28:55 +0000
commitdcd451045fb1b2b070b03df32134a22cb6222268 (patch)
tree7e531f58ebdb552621271551722a7b6c82997646
parent5034bc10afb736eedca0cb4e0503652711008e23 (diff)
downloadheat-dcd451045fb1b2b070b03df32134a22cb6222268.tar.gz
Fix no message attribute in exception
For py35, message attribute in exception seems removed. We should directly get the string message from exception object if message attribute not presented. And since get message attribute already been deprecated. We should remove sopport on exception.message after we fully jump to py35. Partial-Bug: #1704725 Change-Id: I3970aa7c161aa82d179779f1a2f46405d5b0dddb (cherry picked from commit 4ba0b5fe7f31d4353e9c091b03df7324d1c20e88)
-rw-r--r--heat/common/pluginutils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/heat/common/pluginutils.py b/heat/common/pluginutils.py
index 831f89cb0..fd579600d 100644
--- a/heat/common/pluginutils.py
+++ b/heat/common/pluginutils.py
@@ -12,6 +12,7 @@
# under the License.
from oslo_log import log as logging
+import six
from heat.common.i18n import _LW
@@ -22,5 +23,6 @@ def log_fail_msg(manager, entrypoint, exception):
LOG.warning(_LW('Encountered exception while loading %(module_name)s: '
'"%(message)s". Not using %(name)s.'),
{'module_name': entrypoint.module_name,
- 'message': exception.message,
+ 'message': getattr(exception, 'message',
+ six.text_type(exception)),
'name': entrypoint.name})