Make exception catching more python3-ish

There are some codes still using e.message for logging with e is the
exception. As e.message is not compatibale with python3, this patch replaces it.

Change-Id: I5b1158aad6d5b6e8875aee8e7e8eba59a13c0409
This commit is contained in:
Cuong Nguyen 2017-01-17 09:43:27 +07:00
parent 38f4455f1b
commit 03069bfa5d
2 changed files with 3 additions and 3 deletions

View File

@ -68,7 +68,7 @@ class FloatingIPController(rest.RestController):
try:
body = request.body_dict
except Exception as e:
if e.message != 'TODO: Unsupported Content Type':
if str(e) != 'TODO: Unsupported Content Type':
raise
else:
# Got a blank body

View File

@ -72,8 +72,8 @@ def filter_exceptions(fn):
except exceptions.Backend as e:
raise e
except Exception as e:
LOG.error(_LE("Unhandled exception %s"), e.message, exc_info=True)
raise exceptions.Backend(e.message)
LOG.error(_LE("Unhandled exception %s"), e, exc_info=True)
raise exceptions.Backend(e)
return wrapper