Commit 0ede1d85 authored by Rafael Monnerat's avatar Rafael Monnerat

py3: 2to3 -j 20 --write --nobackups --no-diffs --fix=except master

parent d006f91e
...@@ -126,7 +126,7 @@ try: ...@@ -126,7 +126,7 @@ try:
instance_tree.activate(activity="SQLQueue", tag=tag, instance_tree.activate(activity="SQLQueue", tag=tag,
after_tag="allocate_%s" % compute_partition_url).getId() after_tag="allocate_%s" % compute_partition_url).getId()
except ValueError, e: except ValueError as e:
# It was not possible to find free Compute Partition # It was not possible to find free Compute Partition
markHistory(software_instance, 'Allocation failed: no free Compute Partition %s' % e) markHistory(software_instance, 'Allocation failed: no free Compute Partition %s' % e)
else: else:
......
...@@ -17,7 +17,7 @@ currency_value = portal.restrictedTraverse(price_currency) ...@@ -17,7 +17,7 @@ currency_value = portal.restrictedTraverse(price_currency)
# create the subscription request, which will lead to the Open Order # create the subscription request, which will lead to the Open Order
try: try:
subscription_request = resource.Resource_createSubscriptionRequest(customer, [], project, currency_value=currency_value) subscription_request = resource.Resource_createSubscriptionRequest(customer, [], project, currency_value=currency_value)
except AssertionError, e: except AssertionError as e:
if batch: if batch:
raise raise
return context.Base_redirect( return context.Base_redirect(
......
...@@ -92,11 +92,11 @@ def convertToREST(function): ...@@ -92,11 +92,11 @@ def convertToREST(function):
""" """
try: try:
retval = function(self, *args, **kwd) retval = function(self, *args, **kwd)
except (ValueError, AttributeError), log: except (ValueError, AttributeError) as log:
LOG('SlapTool', INFO, 'Converting ValueError to NotFound, real error:', LOG('SlapTool', INFO, 'Converting ValueError to NotFound, real error:',
error=True) error=True)
raise NotFound(log) raise NotFound(log)
except SoftwareInstanceNotReady, log: except SoftwareInstanceNotReady as log:
self.REQUEST.response.setStatus(408) self.REQUEST.response.setStatus(408)
self.REQUEST.response.setHeader('Cache-Control', 'private') self.REQUEST.response.setHeader('Cache-Control', 'private')
return self.REQUEST.response return self.REQUEST.response
......
...@@ -58,7 +58,7 @@ if destination_decision_value is None: ...@@ -58,7 +58,7 @@ if destination_decision_value is None:
try: try:
subscription_request = service.Resource_createSubscriptionRequest(destination_decision_value, resource_vcl, project_value, currency_value=currency_value, default_price=default_price) subscription_request = service.Resource_createSubscriptionRequest(destination_decision_value, resource_vcl, project_value, currency_value=currency_value, default_price=default_price)
except AssertionError, error: except AssertionError as error:
storeWorkflowComment(item, str(error)) storeWorkflowComment(item, str(error))
return return
subscription_request.setAggregateValue(item) subscription_request.setAggregateValue(item)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment