Merge "Use Python 3.x compatible except construct"
This commit is contained in:
commit
38e39fba8a
@ -33,7 +33,7 @@ class NodesController(rest.RestController):
|
||||
|
||||
try:
|
||||
node = db_api.get_node(node_id)
|
||||
except exception.TuskarException, e:
|
||||
except exception.TuskarException as e:
|
||||
response = api.Response(None,
|
||||
error=Error(faultcode=e.code,
|
||||
faultstring=str(e)),
|
||||
|
@ -89,7 +89,7 @@ class RacksController(rest.RestController):
|
||||
db_api = pecan.request.dbapi
|
||||
try:
|
||||
rack = db_api.get_rack(rack_id)
|
||||
except exception.TuskarException, e:
|
||||
except exception.TuskarException as e:
|
||||
response = api.Response(
|
||||
None,
|
||||
error=Error(faultcode=e.code, faultstring=str(e)),
|
||||
@ -115,7 +115,7 @@ class RacksController(rest.RestController):
|
||||
#
|
||||
# TODO(mfojtik): Update the HEAT template at this point
|
||||
#
|
||||
except exception.TuskarException, e:
|
||||
except exception.TuskarException as e:
|
||||
response = api.Response(
|
||||
Error(faultcode=e.code, faultstring=str(e)),
|
||||
status_code=e.code)
|
||||
|
@ -81,7 +81,7 @@ def wrap_exception(notifier=None, publisher_id=None, event_type=None,
|
||||
# contain confidential information.
|
||||
try:
|
||||
return f(self, context, *args, **kw)
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
with excutils.save_and_reraise_exception():
|
||||
if notifier:
|
||||
payload = dict(exception=e)
|
||||
|
Loading…
x
Reference in New Issue
Block a user