Merge "Use Python 3.x compatible except construct"

This commit is contained in:
Jenkins 2013-11-01 09:07:32 +00:00 committed by Gerrit Code Review
commit 38e39fba8a
3 changed files with 4 additions and 4 deletions

View File

@ -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)),

View File

@ -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)

View File

@ -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)