Replace e.message with str(e)

The 'message' attribute has been deprecated. A prefered way is to
call str(e), and this patch will replace e.message with str(e).
For more information, please see:
https://www.python.org/dev/peps/pep-0352/

Change-Id: I96cbd859b172291564188a0a9fbc5372d2bf4bae
This commit is contained in:
howardlee 2017-07-20 16:45:19 +08:00
parent 12144fbe78
commit 9734e4dac5
2 changed files with 3 additions and 3 deletions

View File

@ -31,5 +31,5 @@ class BlockerDeviceManager(object):
.read().rstrip('\n')
return (float(nr_sectors) * float(sect_size)) / units.Gi
except IOError as e:
LOG.error("Failed to read device size. %s", e)
raise exceptions.FuxiException(e.message)
LOG.error("Failed to read device size. %s", str(e))
raise exceptions.FuxiException(str(e))

View File

@ -149,4 +149,4 @@ def do_mount(devpath, mountpoint, fstype):
mounter.mount(devpath, mountpoint, fstype)
except exceptions.FuxiException as e:
with excutils.save_and_reraise_exception():
LOG.error(e.message)
LOG.error(str(e))