"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "zaqar/storage/base.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).

base.py  (zaqar-9.0.0):base.py  (zaqar-10.0.0)
skipping to change at line 154 skipping to change at line 154
# NOTE (flwang): Using time.time() instead of timeit since timeit will # NOTE (flwang): Using time.time() instead of timeit since timeit will
# make the method calling be complicated. # make the method calling be complicated.
def _handle_status(operation_type, callable_operation): def _handle_status(operation_type, callable_operation):
succeeded = True succeeded = True
ref = None ref = None
result = None result = None
try: try:
start = time.time() start = time.time()
result = callable_operation() result = callable_operation()
except Exception as e: except Exception:
ref = uuidutils.generate_uuid() ref = uuidutils.generate_uuid()
LOG.exception(e, extra={'instance_uuid': ref}) LOG.exception('Error calling operation.',
extra={'instance_uuid': ref})
succeeded = False succeeded = False
status = status_template(succeeded, time.time() - start, ref) status = status_template(succeeded, time.time() - start, ref)
op_status[operation_type] = status op_status[operation_type] = status
return succeeded, result return succeeded, result
# create queue # create queue
func = functools.partial(self.queue_controller.create, func = functools.partial(self.queue_controller.create,
queue, project=project) queue, project=project)
succeeded, _ = _handle_status('create_queue', func) succeeded, _ = _handle_status('create_queue', func)
skipping to change at line 414 skipping to change at line 415
:param name: The queue name :param name: The queue name
:param project: Project id :param project: Project id
:returns: Dictionary with the :returns: Dictionary with the
queue stats queue stats
""" """
return self._stats(name, project) return self._stats(name, project)
_stats = abc.abstractmethod(lambda x: None) _stats = abc.abstractmethod(lambda x: None)
def calculate_resource_count(self, project=None):
"""Base method for calculate queues amount.
:param project: Project id
:returns: The number of queues.
"""
return self._calculate_resource_count(project)
_calculate_resource_count = abc.abstractmethod(lambda x: None)
@six.add_metaclass(abc.ABCMeta) @six.add_metaclass(abc.ABCMeta)
class Message(ControllerBase): class Message(ControllerBase):
"""This class is responsible for managing message CRUD.""" """This class is responsible for managing message CRUD."""
@abc.abstractmethod @abc.abstractmethod
def list(self, queue, project=None, marker=None, def list(self, queue, project=None, marker=None,
limit=DEFAULT_MESSAGES_PER_PAGE, limit=DEFAULT_MESSAGES_PER_PAGE,
echo=False, client_uuid=None, echo=False, client_uuid=None,
include_claimed=False, include_delayed=False): include_claimed=False, include_delayed=False):
"""Base method for listing messages. """Base method for listing messages.
 End of changes. 3 change blocks. 
2 lines changed or deleted 13 lines changed or added

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