"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "zaqar/transport/wsgi/v2_0/claims.py" between
zaqar-9.0.0.tar.gz and zaqar-10.0.0.tar.gz

About: OpenStack Zaqar is a multi-tenant cloud messaging and notification service for web and mobile developers.
The "Ussuri" series (latest release).

claims.py  (zaqar-9.0.0):claims.py  (zaqar-10.0.0)
skipping to change at line 94 skipping to change at line 94
**claim_options) **claim_options)
# Buffer claimed messages # Buffer claimed messages
# TODO(kgriffs): optimize, along with serialization (below) # TODO(kgriffs): optimize, along with serialization (below)
resp_msgs = list(msgs) resp_msgs = list(msgs)
except validation.ValidationFailed as ex: except validation.ValidationFailed as ex:
LOG.debug(ex) LOG.debug(ex)
raise wsgi_errors.HTTPBadRequestAPI(six.text_type(ex)) raise wsgi_errors.HTTPBadRequestAPI(six.text_type(ex))
except Exception as ex: except Exception:
LOG.exception(ex)
description = _(u'Claim could not be created.') description = _(u'Claim could not be created.')
LOG.exception(description)
raise wsgi_errors.HTTPServiceUnavailable(description) raise wsgi_errors.HTTPServiceUnavailable(description)
# Serialize claimed messages, if any. This logic assumes # Serialize claimed messages, if any. This logic assumes
# the storage driver returned well-formed messages. # the storage driver returned well-formed messages.
if len(resp_msgs) != 0: if len(resp_msgs) != 0:
base_path = req.path.rpartition('/')[0] base_path = req.path.rpartition('/')[0]
resp_msgs = [wsgi_utils.format_message_v1_1(msg, base_path, cid) resp_msgs = [wsgi_utils.format_message_v1_1(msg, base_path, cid)
for msg in resp_msgs] for msg in resp_msgs]
resp.location = req.path + '/' + cid resp.location = req.path + '/' + cid
skipping to change at line 142 skipping to change at line 142
claim_id=claim_id, claim_id=claim_id,
project=project_id) project=project_id)
# Buffer claimed messages # Buffer claimed messages
# TODO(kgriffs): Optimize along with serialization (see below) # TODO(kgriffs): Optimize along with serialization (see below)
meta['messages'] = list(msgs) meta['messages'] = list(msgs)
except storage_errors.DoesNotExist as ex: except storage_errors.DoesNotExist as ex:
LOG.debug(ex) LOG.debug(ex)
raise wsgi_errors.HTTPNotFound(six.text_type(ex)) raise wsgi_errors.HTTPNotFound(six.text_type(ex))
except Exception as ex: except Exception:
LOG.exception(ex)
description = _(u'Claim could not be queried.') description = _(u'Claim could not be queried.')
LOG.exception(description)
raise wsgi_errors.HTTPServiceUnavailable(description) raise wsgi_errors.HTTPServiceUnavailable(description)
# Serialize claimed messages # Serialize claimed messages
# TODO(kgriffs): Optimize # TODO(kgriffs): Optimize
base_path = req.path.rsplit('/', 2)[0] base_path = req.path.rsplit('/', 2)[0]
meta['messages'] = [wsgi_utils.format_message_v1_1(msg, base_path, meta['messages'] = [wsgi_utils.format_message_v1_1(msg, base_path,
claim_id) claim_id)
for msg in meta['messages']] for msg in meta['messages']]
meta['href'] = req.path meta['href'] = req.path
skipping to change at line 185 skipping to change at line 185
resp.status = falcon.HTTP_204 resp.status = falcon.HTTP_204
except validation.ValidationFailed as ex: except validation.ValidationFailed as ex:
LOG.debug(ex) LOG.debug(ex)
raise wsgi_errors.HTTPBadRequestAPI(six.text_type(ex)) raise wsgi_errors.HTTPBadRequestAPI(six.text_type(ex))
except storage_errors.DoesNotExist as ex: except storage_errors.DoesNotExist as ex:
LOG.debug(ex) LOG.debug(ex)
raise wsgi_errors.HTTPNotFound(six.text_type(ex)) raise wsgi_errors.HTTPNotFound(six.text_type(ex))
except Exception as ex: except Exception:
LOG.exception(ex)
description = _(u'Claim could not be updated.') description = _(u'Claim could not be updated.')
LOG.exception(description)
raise wsgi_errors.HTTPServiceUnavailable(description) raise wsgi_errors.HTTPServiceUnavailable(description)
@decorators.TransportLog("Claims item") @decorators.TransportLog("Claims item")
@acl.enforce("claims:delete") @acl.enforce("claims:delete")
def on_delete(self, req, resp, project_id, queue_name, claim_id): def on_delete(self, req, resp, project_id, queue_name, claim_id):
try: try:
self._claim_controller.delete(queue_name, self._claim_controller.delete(queue_name,
claim_id=claim_id, claim_id=claim_id,
project=project_id) project=project_id)
resp.status = falcon.HTTP_204 resp.status = falcon.HTTP_204
except Exception as ex: except Exception:
LOG.exception(ex)
description = _(u'Claim could not be deleted.') description = _(u'Claim could not be deleted.')
LOG.exception(description)
raise wsgi_errors.HTTPServiceUnavailable(description) raise wsgi_errors.HTTPServiceUnavailable(description)
 End of changes. 8 change blocks. 
8 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)