Hello community, here is the log from the commit of package python-kombu for openSUSE:Factory checked in at 2012-12-03 11:26:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-kombu (Old) and /work/SRC/openSUSE:Factory/.python-kombu.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-kombu", Maintainer is "cth...@suse.com" Changes: -------- --- /work/SRC/openSUSE:Factory/python-kombu/python-kombu.changes 2012-11-12 11:37:03.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python-kombu.new/python-kombu.changes 2012-12-03 11:26:56.000000000 +0100 @@ -1,0 +2,31 @@ +Sat Dec 1 21:56:00 UTC 2012 - toddrme2...@gmail.com + +- Only require python-importlib for SLE. It is not needed for any + distro running python >= 2.7, and is not being built for those + distros. + +------------------------------------------------------------------- +Thu Nov 29 10:07:56 UTC 2012 - iartar...@suse.cz + +- Add python-importlib dependency + +------------------------------------------------------------------- +Sun Nov 25 11:27:04 UTC 2012 - alexan...@exatati.com.br + +- Update to 2.4.10: + - Redis: Fixed race condition that could occur while trying to + restore messages (Issue #171). + Fix contributed by Ollie Walsh. + - Redis: Each channel is now using a specific connection pool + instance, which is disconnected on connection failure. + - ProducerPool: Fixed possible dead-lock in the acquire method. + - ProducerPool: force_close_all no longer tries to call the + non-existent Producer._close. + - librabbitmq: Now implements transport.verify_connection so + that connection pools will not give back connections that are + no longer working. + - New and better repr() for Queue and Exchange objects. + - Python3: Fixed problem with running the unit test suite. + - Python3: Fixed problem with JSON codec. + +------------------------------------------------------------------- Old: ---- kombu-2.4.8.tar.gz New: ---- kombu-2.4.10.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-kombu.spec ++++++ --- /var/tmp/diff_new_pack.NwuLW5/_old 2012-12-03 11:26:57.000000000 +0100 +++ /var/tmp/diff_new_pack.NwuLW5/_new 2012-12-03 11:26:57.000000000 +0100 @@ -16,16 +16,16 @@ # Name: python-kombu -Version: 2.4.8 +Version: 2.4.10 Release: 0 License: BSD-2-Clause Summary: AMQP Messaging Framework for Python Url: http://github.com/ask/kombu/ Group: Development/Languages/Python Source: http://pypi.python.org/packages/source/k/kombu/kombu-%{version}.tar.gz +BuildRequires: python-devel BuildRequires: python-amqplib BuildRequires: python-anyjson -BuildRequires: python-devel BuildRequires: python-distribute BuildRequires: python-mock BuildRequires: python-msgpack-python @@ -41,6 +41,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} && 0%{?suse_version} <= 1110 %{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +BuildRequires: python-importlib %py_requires %else BuildArch: noarch ++++++ kombu-2.4.8.tar.gz -> kombu-2.4.10.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/AUTHORS new/kombu-2.4.10/AUTHORS --- old/kombu-2.4.8/AUTHORS 2012-11-02 17:35:08.000000000 +0100 +++ new/kombu-2.4.10/AUTHORS 2012-11-22 18:39:38.000000000 +0100 @@ -45,6 +45,7 @@ Michael Barrett <m...@eventbrite.com> Nitzan Miron <bug.assem...@bugbug.me> Noah Kantrowitz <n...@coderanger.net> +Ollie Walsh <ollie.wa...@geemail.kom> Pascal Hartig <phar...@rdrei.net> Patrick Schneider <patrick.p2k.schnei...@gmail.com> Paul McLanahan <p...@mclanahan.net> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/Changelog new/kombu-2.4.10/Changelog --- old/kombu-2.4.8/Changelog 2012-11-02 17:54:07.000000000 +0100 +++ new/kombu-2.4.10/Changelog 2012-11-22 18:45:28.000000000 +0100 @@ -4,20 +4,73 @@ Change history ================ +.. _version-2.4.10: + +2.4.10 +====== +:release-date: 2012-11-22 06:00 P.M UTC + +- The previous versions connection pool changes broke Redis support so that + it would always connect to localhost (default setting) no matter what + connection parameters were provided (Issue #176). + +.. _version-2.4.9: + +2.4.9 +===== +:release-date: 2012-11-21 03:00 P.M UTC + +- Redis: Fixed race condition that could occur while trying to restore + messages (Issue #171). + + Fix contributed by Ollie Walsh. + +- Redis: Each channel is now using a specific connection pool instance, + which is disconnected on connection failure. + +- ProducerPool: Fixed possible dead-lock in the acquire method. + +- ProducerPool: ``force_close_all`` no longer tries to call the non-existent + ``Producer._close``. + +- librabbitmq: Now implements ``transport.verify_connection`` so that + connection pools will not give back connections that are no longer working. + +- New and better ``repr()`` for Queue and Exchange objects. + +- Python3: Fixed problem with running the unit test suite. + +- Python3: Fixed problem with JSON codec. + .. _version-2.4.8: 2.4.8 ===== :release-date: 2012-11-02 05:00 P.M UTC -- Redis: Fair queue cyle implementation improved (Issue #166). +- Redis: Improved fair queue cycle implementation (Issue #166). Contributed by Kevin McCarthy. -- Redis: Number of messages to restore in one iteration is now unlimited, - but can be configured using the unacked_restore_limit transport option. +- Redis: Unacked message restore limit is now unlimited by default. + + Also, the limit can now be configured using the ``unacked_restore_limit`` + transport option: + + .. code-block:: python + + Connection('redis://', transport_options={ + 'unacked_restore_limit': 100, + }) + + A limit of 100 means that the consumer will restore at most 100 + messages at each pass. + +- Redis: Now uses a mutex to ensure only one consumer restores messages at a + time. -- Redis: A Redis based mutex is now used while restoring messages. + The mutex expires after 5 minutes by default, but can be configured + using the ``unacked_mutex_expire`` transport option. - LamportClock.adjust now returns the new clock value. @@ -31,7 +84,9 @@ Fix contributed by Jasper Bryant-Greene +- amqplib: Fixed bug with timeouts when SSL is used in non-blocking mode. + Fix contributed by Mher Movsisyan .. _version-2.4.7: @@ -76,9 +131,10 @@ 2.4.5 ===== -:release-date: 2012-08-30 04:00 P.M BST +:release-date: 2012-08-30 03:36 P.M BST -- Fixed Jython + PyPy installation. +- Last version broke installtion on PyPy and Jython due + to test requirements clean-up. .. _version-2.4.4: @@ -248,7 +304,7 @@ ===== :release-date: 2012-07-10 17:00 P.M BST -- Adds ``messaging.entry_to_queue`` for compat with previous versions. +- Adds ``kombu.messaging.entry_to_queue`` for compat with previous versions. .. _version-2.2.5: @@ -914,7 +970,7 @@ declare=[exchange], retry_policy={ 'interval_start': 1.0}) - See :meth:`~kombu.connection.Connection.ensure` + See :meth:`~kombu.Connection.ensure` for a list of supported retry policy options. * ``Producer.publish`` now supports a ``declare`` keyword argument. @@ -1074,7 +1130,7 @@ This module contains a :class:`~kombu.mixins.ConsumerMixin` class that can be used to easily implement a message consumer thread that consumes messages from one or more - :class:`kombu.messaging.Consumer` instances. + :class:`kombu.Consumer` instances. * New example: :ref:`task-queue-example` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/PKG-INFO new/kombu-2.4.10/PKG-INFO --- old/kombu-2.4.8/PKG-INFO 2012-11-02 17:55:55.000000000 +0100 +++ new/kombu-2.4.10/PKG-INFO 2012-11-22 18:47:07.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: kombu -Version: 2.4.8 +Version: 2.4.10 Summary: Messaging Framework for Python Home-page: http://kombu.readthedocs.org Author: Ask Solem @@ -10,7 +10,7 @@ kombu - Messaging Framework for Python ======================================== - :Version: 2.4.8 + :Version: 2.4.10 `Kombu` is a messaging framework for Python. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/README new/kombu-2.4.10/README --- old/kombu-2.4.8/README 2012-11-02 17:54:19.000000000 +0100 +++ new/kombu-2.4.10/README 2012-11-22 18:45:37.000000000 +0100 @@ -2,7 +2,7 @@ kombu - Messaging Framework for Python ======================================== -:Version: 2.4.8 +:Version: 2.4.10 `Kombu` is a messaging framework for Python. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/README.rst new/kombu-2.4.10/README.rst --- old/kombu-2.4.8/README.rst 2012-11-02 17:54:19.000000000 +0100 +++ new/kombu-2.4.10/README.rst 2012-11-22 18:45:37.000000000 +0100 @@ -2,7 +2,7 @@ kombu - Messaging Framework for Python ======================================== -:Version: 2.4.8 +:Version: 2.4.10 `Kombu` is a messaging framework for Python. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/docs/changelog.rst new/kombu-2.4.10/docs/changelog.rst --- old/kombu-2.4.8/docs/changelog.rst 2012-11-02 17:54:07.000000000 +0100 +++ new/kombu-2.4.10/docs/changelog.rst 2012-11-22 18:45:28.000000000 +0100 @@ -4,20 +4,73 @@ Change history ================ +.. _version-2.4.10: + +2.4.10 +====== +:release-date: 2012-11-22 06:00 P.M UTC + +- The previous versions connection pool changes broke Redis support so that + it would always connect to localhost (default setting) no matter what + connection parameters were provided (Issue #176). + +.. _version-2.4.9: + +2.4.9 +===== +:release-date: 2012-11-21 03:00 P.M UTC + +- Redis: Fixed race condition that could occur while trying to restore + messages (Issue #171). + + Fix contributed by Ollie Walsh. + +- Redis: Each channel is now using a specific connection pool instance, + which is disconnected on connection failure. + +- ProducerPool: Fixed possible dead-lock in the acquire method. + +- ProducerPool: ``force_close_all`` no longer tries to call the non-existent + ``Producer._close``. + +- librabbitmq: Now implements ``transport.verify_connection`` so that + connection pools will not give back connections that are no longer working. + +- New and better ``repr()`` for Queue and Exchange objects. + +- Python3: Fixed problem with running the unit test suite. + +- Python3: Fixed problem with JSON codec. + .. _version-2.4.8: 2.4.8 ===== :release-date: 2012-11-02 05:00 P.M UTC -- Redis: Fair queue cyle implementation improved (Issue #166). +- Redis: Improved fair queue cycle implementation (Issue #166). Contributed by Kevin McCarthy. -- Redis: Number of messages to restore in one iteration is now unlimited, - but can be configured using the unacked_restore_limit transport option. +- Redis: Unacked message restore limit is now unlimited by default. + + Also, the limit can now be configured using the ``unacked_restore_limit`` + transport option: + + .. code-block:: python + + Connection('redis://', transport_options={ + 'unacked_restore_limit': 100, + }) + + A limit of 100 means that the consumer will restore at most 100 + messages at each pass. + +- Redis: Now uses a mutex to ensure only one consumer restores messages at a + time. -- Redis: A Redis based mutex is now used while restoring messages. + The mutex expires after 5 minutes by default, but can be configured + using the ``unacked_mutex_expire`` transport option. - LamportClock.adjust now returns the new clock value. @@ -31,7 +84,9 @@ Fix contributed by Jasper Bryant-Greene +- amqplib: Fixed bug with timeouts when SSL is used in non-blocking mode. + Fix contributed by Mher Movsisyan .. _version-2.4.7: @@ -76,9 +131,10 @@ 2.4.5 ===== -:release-date: 2012-08-30 04:00 P.M BST +:release-date: 2012-08-30 03:36 P.M BST -- Fixed Jython + PyPy installation. +- Last version broke installtion on PyPy and Jython due + to test requirements clean-up. .. _version-2.4.4: @@ -248,7 +304,7 @@ ===== :release-date: 2012-07-10 17:00 P.M BST -- Adds ``messaging.entry_to_queue`` for compat with previous versions. +- Adds ``kombu.messaging.entry_to_queue`` for compat with previous versions. .. _version-2.2.5: @@ -914,7 +970,7 @@ declare=[exchange], retry_policy={ 'interval_start': 1.0}) - See :meth:`~kombu.connection.Connection.ensure` + See :meth:`~kombu.Connection.ensure` for a list of supported retry policy options. * ``Producer.publish`` now supports a ``declare`` keyword argument. @@ -1074,7 +1130,7 @@ This module contains a :class:`~kombu.mixins.ConsumerMixin` class that can be used to easily implement a message consumer thread that consumes messages from one or more - :class:`kombu.messaging.Consumer` instances. + :class:`kombu.Consumer` instances. * New example: :ref:`task-queue-example` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/docs/introduction.rst new/kombu-2.4.10/docs/introduction.rst --- old/kombu-2.4.8/docs/introduction.rst 2012-11-02 17:54:19.000000000 +0100 +++ new/kombu-2.4.10/docs/introduction.rst 2012-11-22 18:45:37.000000000 +0100 @@ -2,7 +2,7 @@ kombu - Messaging Framework for Python ======================================== -:Version: 2.4.8 +:Version: 2.4.10 `Kombu` is a messaging framework for Python. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/kombu/__init__.py new/kombu-2.4.10/kombu/__init__.py --- old/kombu-2.4.8/kombu/__init__.py 2012-11-02 17:54:19.000000000 +0100 +++ new/kombu-2.4.10/kombu/__init__.py 2012-11-22 18:45:37.000000000 +0100 @@ -1,7 +1,7 @@ """Messaging Framework for Python""" from __future__ import absolute_import -VERSION = (2, 4, 8) +VERSION = (2, 4, 10) __version__ = '.'.join(map(str, VERSION[0:3])) + ''.join(VERSION[3:]) __author__ = 'Ask Solem' __contact__ = 'a...@celeryproject.org' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/kombu/abstract.py new/kombu-2.4.10/kombu/abstract.py --- old/kombu-2.4.8/kombu/abstract.py 2012-07-30 15:20:21.000000000 +0200 +++ new/kombu-2.4.10/kombu/abstract.py 2012-11-22 18:39:40.000000000 +0100 @@ -98,8 +98,8 @@ def __repr__(self, item=''): if self.is_bound: - return '<bound %s of %s>' % (item or self.__class__.__name__, - self.channel) + return '<%s bound to chan:%s>' % ( + item or type(self).__name__, self.channel.channel_id) return '<unbound %s>' % (item, ) @property diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/kombu/connection.py new/kombu-2.4.10/kombu/connection.py --- old/kombu-2.4.8/kombu/connection.py 2012-11-02 17:35:09.000000000 +0100 +++ new/kombu-2.4.10/kombu/connection.py 2012-11-22 18:39:40.000000000 +0100 @@ -709,7 +709,10 @@ except Empty: self._add_when_empty() else: - R = self.prepare(R) + try: + R = self.prepare(R) + except BaseException: + self.release_resource(R) self._dirty.add(R) break else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/kombu/entity.py new/kombu-2.4.10/kombu/entity.py --- old/kombu-2.4.8/kombu/entity.py 2012-11-02 17:35:09.000000000 +0100 +++ new/kombu-2.4.10/kombu/entity.py 2012-11-22 18:39:40.000000000 +0100 @@ -239,8 +239,10 @@ return False def __repr__(self): - return super(Exchange, self).__repr__('Exchange %s(%s)' % (self.name, - self.type)) + return super(Exchange, self).__repr__(str(self)) + + def __str__(self): + return 'Exchange %s(%s)' % (self.name, self.type) @property def can_cache_declaration(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/kombu/pools.py new/kombu-2.4.10/kombu/pools.py --- old/kombu-2.4.8/kombu/pools.py 2012-06-14 22:37:12.000000000 +0200 +++ new/kombu-2.4.10/kombu/pools.py 2012-11-22 18:39:40.000000000 +0100 @@ -39,7 +39,12 @@ return self.connections.acquire(block=True) def create_producer(self): - return self.Producer(self._acquire_connection()) + conn = self._acquire_connection() + try: + return self.Producer(conn) + except BaseException: + conn.release() + raise def new(self): return lambda: self.create_producer() @@ -49,12 +54,19 @@ for _ in xrange(self.limit): self._resource.put_nowait(self.new()) + def close_resource(self, resource): + pass + def prepare(self, p): if callable(p): p = p() if not p.channel: - connection = self._acquire_connection() - p.revive(connection.default_channel) + conn = self._acquire_connection() + try: + p.revive(conn.default_channel) + except BaseException: + conn.release() + raise return p def release(self, resource): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/kombu/serialization.py new/kombu-2.4.10/kombu/serialization.py --- old/kombu-2.4.8/kombu/serialization.py 2012-11-02 17:35:09.000000000 +0100 +++ new/kombu-2.4.10/kombu/serialization.py 2012-11-22 18:39:40.000000000 +0100 @@ -21,7 +21,7 @@ cpickle = None # noqa from .exceptions import SerializerNotInstalled -from .utils.encoding import bytes_to_str, str_to_bytes, bytes_t +from .utils.encoding import str_to_bytes, bytes_t __all__ = ['pickle', 'encode', 'decode', 'register', 'unregister'] @@ -295,8 +295,8 @@ from anyjson import loads, dumps def _loads(obj): - if isinstance(obj, str): - obj = bytes_to_str(obj) + if isinstance(obj, bytes): + obj = obj.decode() return loads(obj) registry.register('json', dumps, _loads, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/kombu/tests/mocks.py new/kombu-2.4.10/kombu/tests/mocks.py --- old/kombu-2.4.8/kombu/tests/mocks.py 2012-11-02 17:35:09.000000000 +0100 +++ new/kombu-2.4.10/kombu/tests/mocks.py 2012-11-22 18:39:40.000000000 +0100 @@ -22,6 +22,7 @@ class Channel(base.StdChannel): open = True throw_decode_error = False + _next_id = count(1).next def __init__(self, connection): self.connection = connection @@ -29,6 +30,7 @@ self.deliveries = count(1).next self.to_deliver = [] self.events = {'basic_return': []} + self.channel_id = self._next_id() def _called(self, name): self.called.append(name) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/kombu/tests/test_entities.py new/kombu-2.4.10/kombu/tests/test_entities.py --- old/kombu-2.4.8/kombu/tests/test_entities.py 2012-11-02 17:35:09.000000000 +0100 +++ new/kombu-2.4.10/kombu/tests/test_entities.py 2012-11-22 18:39:41.000000000 +0100 @@ -25,7 +25,7 @@ bound = exchange.bind(chan) self.assertTrue(bound.is_bound) self.assertIs(bound.channel, chan) - self.assertIn('<bound', repr(bound)) + self.assertIn('bound to chan', repr(bound)) def test_hash(self): self.assertEqual(hash(Exchange('a')), hash(Exchange('a'))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/kombu/tests/transport/test_redis.py new/kombu-2.4.10/kombu/tests/transport/test_redis.py --- old/kombu-2.4.8/kombu/tests/transport/test_redis.py 2012-11-02 17:35:09.000000000 +0100 +++ new/kombu-2.4.10/kombu/tests/transport/test_redis.py 2012-11-22 18:46:12.000000000 +0100 @@ -43,9 +43,7 @@ hashes = defaultdict(dict) shard_hint = None - def __init__(self, db=None, port=None, **kwargs): - self.port = port - self.db = db + def __init__(self, db=None, port=None, connection_pool=None, **kwargs): self._called = [] self._connection = None self.bgsave_raises_ResponseError = False @@ -385,7 +383,7 @@ self.channel.connection.client.virtual_host = 'xfeqwewkfk' with self.assertRaises(ValueError): - self.channel._create_client() + self.channel._get_pool() @skip_if_not_module('redis') def test_get_client(self): @@ -393,14 +391,14 @@ KombuRedis = redis.Channel._get_client(self.channel) self.assertTrue(KombuRedis) - Rv = getattr(R, '__version__') + Rv = getattr(R, 'VERSION', None) try: - R.__version__ = '2.4.0' + R.VERSION = (2, 4, 0) with self.assertRaises(VersionMismatch): redis.Channel._get_client(self.channel) finally: if Rv is not None: - R.__version__ = Rv + R.VERSION = Rv @skip_if_not_module('redis') def test_get_response_error(self): @@ -526,17 +524,14 @@ channel.close() def test_db_values(self): - c1 = Connection(virtual_host=1, - transport=Transport).channel() - self.assertEqual(c1.client.db, 1) - - c2 = Connection(virtual_host='1', - transport=Transport).channel() - self.assertEqual(c2.client.db, 1) - - c3 = Connection(virtual_host='/1', - transport=Transport).channel() - self.assertEqual(c3.client.db, 1) + Connection(virtual_host=1, + transport=Transport).channel() + + Connection(virtual_host='1', + transport=Transport).channel() + + Connection(virtual_host='/1', + transport=Transport).channel() with self.assertRaises(Exception): Connection(virtual_host='/foo', @@ -544,11 +539,9 @@ def test_db_port(self): c1 = Connection(port=None, transport=Transport).channel() - self.assertEqual(c1.client.port, Transport.default_port) c1.close() c2 = Connection(port=9999, transport=Transport).channel() - self.assertEqual(c2.client.port, 9999) c2.close() def test_close_poller_not_active(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/kombu/tests/utils.py new/kombu-2.4.10/kombu/tests/utils.py --- old/kombu-2.4.8/kombu/tests/utils.py 2012-06-15 09:18:38.000000000 +0200 +++ new/kombu-2.4.10/kombu/tests/utils.py 2012-11-21 15:00:35.000000000 +0100 @@ -21,8 +21,9 @@ class TestCase(unittest.TestCase): - if not hasattr(unittest.TestCase, 'assertItemsEqual'): - assertItemsEqual = unittest.TestCase.assertSameElements + def assertItemsEqual(self, a, b, *args, **kwargs): + return self.assertEqual(sorted(a), sorted(b), *args, **kwargs) + assertSameElements = assertItemsEqual class Mock(mock.Mock): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/kombu/transport/base.py new/kombu-2.4.10/kombu/transport/base.py --- old/kombu-2.4.8/kombu/transport/base.py 2012-10-24 12:46:10.000000000 +0200 +++ new/kombu-2.4.10/kombu/transport/base.py 2012-11-22 18:39:42.000000000 +0100 @@ -49,10 +49,8 @@ """Base class for received messages.""" __slots__ = ('_state', 'channel', 'delivery_tag', 'content_type', 'content_encoding', - 'delivery_info', 'headers', - 'properties', 'body', - '_decoded_cache', - 'MessageStateError', '__dict__') + 'delivery_info', 'headers', 'properties', + 'body', '_decoded_cache', '__dict__') MessageStateError = MessageStateError def __init__(self, channel, body=None, delivery_tag=None, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/kombu/transport/librabbitmq.py new/kombu-2.4.10/kombu/transport/librabbitmq.py --- old/kombu-2.4.8/kombu/transport/librabbitmq.py 2012-08-29 16:46:47.000000000 +0200 +++ new/kombu-2.4.10/kombu/transport/librabbitmq.py 2012-11-22 18:39:42.000000000 +0100 @@ -115,6 +115,9 @@ """Close the AMQP broker connection.""" connection.close() + def verify_connection(self, connection): + return connection.connected + def on_poll_init(self, poller): pass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/kombu/transport/redis.py new/kombu-2.4.10/kombu/transport/redis.py --- old/kombu-2.4.8/kombu/transport/redis.py 2012-11-02 17:55:12.000000000 +0100 +++ new/kombu-2.4.10/kombu/transport/redis.py 2012-11-22 18:39:50.000000000 +0100 @@ -25,7 +25,6 @@ ) from kombu.log import get_logger from kombu.utils import cached_property, uuid -from kombu.utils.encoding import str_t from kombu.utils.eventio import poll, READ, ERR try: @@ -306,6 +305,7 @@ unacked_restore_limit = None visibility_timeout = 3600 # 1 hour priority_steps = PRIORITY_STEPS + _pool = None from_transport_options = (virtual.Channel.from_transport_options + ('unacked_key', @@ -329,7 +329,12 @@ self.handlers = {'BRPOP': self._brpop_read, 'LISTEN': self._receive} # Evaluate connection. - self.client.info() + try: + self.client.info() + except Exception: + if self._pool: + self._pool.disconnect() + raise self.connection.cycle.add(self) # add to channel poller. # copy errors, in case channel closed but threads still @@ -394,8 +399,8 @@ c = self.subclient if c.connection._sock is None: c.connection.connect() - self.subclient.subscribe(keys) self._in_listen = True + self.subclient.subscribe(keys) def _handle_message(self, client, r): if r[0] == 'unsubscribe' and r[2] == 0: @@ -427,8 +432,8 @@ return keys = [self._q_for_pri(queue, pri) for pri in PRIORITY_STEPS for queue in queues] + [timeout or 0] - self.client.connection.send_command('BRPOP', *keys) self._in_poll = True + self.client.connection.send_command('BRPOP', *keys) def _brpop_read(self, **options): try: @@ -540,6 +545,8 @@ return sum(sizes[::2]) def close(self): + if self._pool: + self._pool.disconnect() if not self.closed: # remove from channel poller. self.connection.cycle.discard(self) @@ -557,7 +564,7 @@ pass super(Channel, self).close() - def _create_client(self): + def _connparams(self): conninfo = self.connection.client database = conninfo.virtual_host if not isinstance(database, int): @@ -570,19 +577,22 @@ except ValueError: raise ValueError( 'Database name must be int between 0 and limit - 1') + return {'host': conninfo.hostname or '127.0.0.1', + 'port': conninfo.port or DEFAULT_PORT, + 'db': database, + 'password': conninfo.password} + + def _create_client(self): + return self.Client(connection_pool=self.pool) - return self.Client(host=conninfo.hostname or '127.0.0.1', - port=conninfo.port or DEFAULT_PORT, - db=database, - password=conninfo.password) + def _get_pool(self): + return redis.ConnectionPool(**self._connparams()) def _get_client(self): - version = getattr(redis, '__version__', (0, 0, 0)) - version = tuple(map(int, version.split('.'))) - if version < (2, 4, 4): + if redis.VERSION < (2, 4, 4): raise VersionMismatch( 'Redis transport requires redis-py versions 2.4.4 or later. ' - 'You have %r' % ('.'.join(map(str_t, version)), )) + 'You have %r' % (redis.__version__, )) # KombuRedis maintains a connection attribute on it's instance and # uses that when executing commands @@ -618,6 +628,12 @@ return self._create_client() return self.client + @property + def pool(self): + if self._pool is None: + self._pool = self._get_pool() + return self._pool + @cached_property def client(self): """Client used to publish messages, BRPOP etc.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.4.8/kombu.egg-info/PKG-INFO new/kombu-2.4.10/kombu.egg-info/PKG-INFO --- old/kombu-2.4.8/kombu.egg-info/PKG-INFO 2012-11-02 17:55:47.000000000 +0100 +++ new/kombu-2.4.10/kombu.egg-info/PKG-INFO 2012-11-22 18:47:02.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: kombu -Version: 2.4.8 +Version: 2.4.10 Summary: Messaging Framework for Python Home-page: http://kombu.readthedocs.org Author: Ask Solem @@ -10,7 +10,7 @@ kombu - Messaging Framework for Python ======================================== - :Version: 2.4.8 + :Version: 2.4.10 `Kombu` is a messaging framework for Python. -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org