Hello community,
here is the log from the commit of package python-amqpstorm for
openSUSE:Factory checked in at 2020-01-17 16:08:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-amqpstorm (Old)
and /work/SRC/openSUSE:Factory/.python-amqpstorm.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-amqpstorm"
Fri Jan 17 16:08:15 2020 rev:9 rq:765072 version:2.7.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-amqpstorm/python-amqpstorm.changes
2019-09-27 14:47:34.868900077 +0200
+++
/work/SRC/openSUSE:Factory/.python-amqpstorm.new.26092/python-amqpstorm.changes
2020-01-17 16:08:24.540525818 +0100
@@ -1,0 +2,6 @@
+Thu Jan 16 17:05:29 UTC 2020 - Marketa Calabkova <[email protected]>
+
+- update to 2.7.2
+ * Added ability to override client_properties
+
+-------------------------------------------------------------------
Old:
----
AMQPStorm-2.7.1.tar.gz
New:
----
AMQPStorm-2.7.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-amqpstorm.spec ++++++
--- /var/tmp/diff_new_pack.Fh4HEC/_old 2020-01-17 16:08:25.652526344 +0100
+++ /var/tmp/diff_new_pack.Fh4HEC/_new 2020-01-17 16:08:25.652526344 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-amqpstorm
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-amqpstorm
-Version: 2.7.1
+Version: 2.7.2
Release: 0
Summary: Thread-safe Python RabbitMQ Client & Management library
License: MIT
++++++ AMQPStorm-2.7.1.tar.gz -> AMQPStorm-2.7.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/AMQPStorm-2.7.1/AMQPStorm.egg-info/PKG-INFO
new/AMQPStorm-2.7.2/AMQPStorm.egg-info/PKG-INFO
--- old/AMQPStorm-2.7.1/AMQPStorm.egg-info/PKG-INFO 2019-06-18
06:07:36.000000000 +0200
+++ new/AMQPStorm-2.7.2/AMQPStorm.egg-info/PKG-INFO 2019-12-02
01:37:00.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: AMQPStorm
-Version: 2.7.1
+Version: 2.7.2
Summary: Thread-safe Python RabbitMQ Client & Management library.
Home-page: https://www.amqpstorm.io
Author: Erik Olof Gunnar Andersson
@@ -29,6 +29,10 @@
Changelog
=========
+ Version 2.7.2
+ -------------
+ - Added ability to override client_properties [#77] - Thanks tkram01.
+
Version 2.7.1
-------------
- Fixed Connection close taking longer than intended when using SSL
[#75]- Thanks troglas.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/AMQPStorm-2.7.1/CHANGELOG.rst
new/AMQPStorm-2.7.2/CHANGELOG.rst
--- old/AMQPStorm-2.7.1/CHANGELOG.rst 2019-06-18 06:07:25.000000000 +0200
+++ new/AMQPStorm-2.7.2/CHANGELOG.rst 2019-12-02 00:53:22.000000000 +0100
@@ -1,9 +1,13 @@
Changelog
=========
+Version 2.7.2
+-------------
+- Added ability to override client_properties [#77] - Thanks tkram01.
+
Version 2.7.1
-------------
-- Fixed Connection close taking longer than intended when using SSL [#75]-
Thanks troglas.
+- Fixed Connection close taking longer than intended when using SSL [#75] -
Thanks troglas.
- Fixed an issue with closing Channels taking too long after the server
initiated it.
Version 2.7.0
@@ -167,4 +171,4 @@
Usage:
except AMQPChannelError as why:
if why.error_code == 312:
- self.channel.queue.declare(queue_name)
\ No newline at end of file
+ self.channel.queue.declare(queue_name)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/AMQPStorm-2.7.1/PKG-INFO new/AMQPStorm-2.7.2/PKG-INFO
--- old/AMQPStorm-2.7.1/PKG-INFO 2019-06-18 06:07:36.000000000 +0200
+++ new/AMQPStorm-2.7.2/PKG-INFO 2019-12-02 01:37:00.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: AMQPStorm
-Version: 2.7.1
+Version: 2.7.2
Summary: Thread-safe Python RabbitMQ Client & Management library.
Home-page: https://www.amqpstorm.io
Author: Erik Olof Gunnar Andersson
@@ -29,6 +29,10 @@
Changelog
=========
+ Version 2.7.2
+ -------------
+ - Added ability to override client_properties [#77] - Thanks tkram01.
+
Version 2.7.1
-------------
- Fixed Connection close taking longer than intended when using SSL
[#75]- Thanks troglas.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/AMQPStorm-2.7.1/README.rst
new/AMQPStorm-2.7.2/README.rst
--- old/AMQPStorm-2.7.1/README.rst 2019-06-18 06:07:25.000000000 +0200
+++ new/AMQPStorm-2.7.2/README.rst 2019-12-02 00:53:32.000000000 +0100
@@ -20,6 +20,10 @@
Changelog
=========
+Version 2.7.2
+-------------
+- Added ability to override client_properties [#77] - Thanks tkram01.
+
Version 2.7.1
-------------
- Fixed Connection close taking longer than intended when using SSL [#75]-
Thanks troglas.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/AMQPStorm-2.7.1/amqpstorm/__init__.py
new/AMQPStorm-2.7.2/amqpstorm/__init__.py
--- old/AMQPStorm-2.7.1/amqpstorm/__init__.py 2019-06-18 06:07:25.000000000
+0200
+++ new/AMQPStorm-2.7.2/amqpstorm/__init__.py 2019-12-02 00:52:17.000000000
+0100
@@ -1,5 +1,5 @@
"""AMQPStorm."""
-__version__ = '2.7.1' # noqa
+__version__ = '2.7.2' # noqa
__author__ = 'eandersson' # noqa
import logging
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/AMQPStorm-2.7.1/amqpstorm/channel0.py
new/AMQPStorm-2.7.2/amqpstorm/channel0.py
--- old/AMQPStorm-2.7.1/amqpstorm/channel0.py 2018-09-10 08:18:55.000000000
+0200
+++ new/AMQPStorm-2.7.2/amqpstorm/channel0.py 2019-12-02 00:51:16.000000000
+0100
@@ -20,7 +20,7 @@
class Channel0(object):
"""Internal Channel0 handler."""
- def __init__(self, connection):
+ def __init__(self, connection, client_properties=None):
super(Channel0, self).__init__()
self.is_blocked = False
self.max_allowed_channels = MAX_CHANNELS
@@ -29,6 +29,7 @@
self._connection = connection
self._heartbeat = connection.parameters['heartbeat']
self._parameters = connection.parameters
+ self._override_client_properties = client_properties
def on_frame(self, frame_in):
"""Handle frames sent to Channel0.
@@ -214,13 +215,12 @@
self._connection.write_frame(0, frame_out)
LOGGER.debug('Frame Sent: %s', frame_out.name)
- @staticmethod
- def _client_properties():
+ def _client_properties(self):
"""AMQPStorm Client Properties.
:rtype: dict
"""
- return {
+ client_properties = {
'product': 'AMQPStorm',
'platform': 'Python %s (%s)' % (platform.python_version(),
platform.python_implementation()),
@@ -234,3 +234,6 @@
'information': 'See https://github.com/eandersson/amqpstorm',
'version': __version__
}
+ if self._override_client_properties:
+ client_properties.update(self._override_client_properties)
+ return client_properties
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/AMQPStorm-2.7.1/amqpstorm/connection.py
new/AMQPStorm-2.7.2/amqpstorm/connection.py
--- old/AMQPStorm-2.7.1/amqpstorm/connection.py 2019-06-18 06:07:25.000000000
+0200
+++ new/AMQPStorm-2.7.2/amqpstorm/connection.py 2019-12-02 00:51:16.000000000
+0100
@@ -44,6 +44,7 @@
:param int|float timeout: Socket timeout
:param bool ssl: Enable SSL
:param dict ssl_options: SSL kwargs (from ssl.wrap_socket)
+ :param dict client_properties: None or dict of client properties
:param bool lazy: Lazy initialize the connection
:raises AMQPConnectionError: Raises if the connection
@@ -61,12 +62,13 @@
'heartbeat': kwargs.get('heartbeat', DEFAULT_HEARTBEAT_INTERVAL),
'timeout': kwargs.get('timeout', DEFAULT_SOCKET_TIMEOUT),
'ssl': kwargs.get('ssl', False),
- 'ssl_options': kwargs.get('ssl_options', {})
+ 'ssl_options': kwargs.get('ssl_options', {}),
+ 'client_properties': kwargs.get('client_properties', {})
}
self._validate_parameters()
self._io = IO(self.parameters, exceptions=self._exceptions,
on_read_impl=self._read_buffer)
- self._channel0 = Channel0(self)
+ self._channel0 = Channel0(self, self.parameters['client_properties'])
self._channels = {}
self._last_channel_id = None
self.heartbeat = Heartbeat(self.parameters['heartbeat'],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/AMQPStorm-2.7.1/amqpstorm/tests/functional/management/connection_tests.py
new/AMQPStorm-2.7.2/amqpstorm/tests/functional/management/connection_tests.py
---
old/AMQPStorm-2.7.1/amqpstorm/tests/functional/management/connection_tests.py
2018-01-17 03:51:54.000000000 +0100
+++
new/AMQPStorm-2.7.2/amqpstorm/tests/functional/management/connection_tests.py
2019-12-02 00:51:16.000000000 +0100
@@ -63,3 +63,24 @@
self.assertEqual(len(api.connection.list()), 0)
connection.close()
+
+ def test_api_connection_client_properties(self):
+ api = ManagementApi(HTTP_URL, USERNAME, PASSWORD, timeout=1)
+
+ self.assertEqual(len(api.connection.list()), 0,
+ 'found an open connection, test will fail')
+
+ cp = {'platform': 'Atari', 'license': 'MIT'}
+ connection = Connection(HOST, USERNAME, PASSWORD, timeout=1,
+ client_properties=cp)
+
+ connections = retry_function_wrapper(api.connection.list)
+
+ self.assertIsNotNone(connections)
+
+ self.assertEqual(len(connections), 1)
+
+ for conn in api.connection.list():
+ self.assertEqual(conn['client_properties']['platform'], 'Atari')
+
+ connection.close()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/AMQPStorm-2.7.1/amqpstorm/tests/unit/channel0/channel0_tests.py
new/AMQPStorm-2.7.2/amqpstorm/tests/unit/channel0/channel0_tests.py
--- old/AMQPStorm-2.7.1/amqpstorm/tests/unit/channel0/channel0_tests.py
2018-11-26 02:01:27.000000000 +0100
+++ new/AMQPStorm-2.7.2/amqpstorm/tests/unit/channel0/channel0_tests.py
2019-12-02 00:51:16.000000000 +0100
@@ -183,3 +183,21 @@
)
self.assertRaises(AMQPConnectionError, connection.check_for_errors)
+
+ def test_channel0_override_client_credentials(self):
+ client_properties = {'platform': 'Atari', 'license': 'MIT'}
+ channel = Channel0(FakeConnection(), client_properties)
+ result = channel._client_properties()
+
+ information = 'See https://github.com/eandersson/amqpstorm'
+
+ self.assertIsInstance(result, dict)
+
+ self.assertTrue(result['capabilities']['authentication_failure_close'])
+ self.assertTrue(result['capabilities']['consumer_cancel_notify'])
+ self.assertTrue(result['capabilities']['publisher_confirms'])
+ self.assertTrue(result['capabilities']['connection.blocked'])
+ self.assertTrue(result['capabilities']['basic.nack'])
+ self.assertEqual(result['information'], information)
+ self.assertEqual(result['platform'], 'Atari')
+ self.assertEqual(result['license'], 'MIT')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/AMQPStorm-2.7.1/amqpstorm/tests/unit/uri_connection/uri_connection_tests.py
new/AMQPStorm-2.7.2/amqpstorm/tests/unit/uri_connection/uri_connection_tests.py
---
old/AMQPStorm-2.7.1/amqpstorm/tests/unit/uri_connection/uri_connection_tests.py
2019-06-18 06:07:25.000000000 +0200
+++
new/AMQPStorm-2.7.2/amqpstorm/tests/unit/uri_connection/uri_connection_tests.py
2019-12-02 00:51:16.000000000 +0100
@@ -176,3 +176,13 @@
self.assertEqual(ssl_options['ssl_version'], ssl.PROTOCOL_TLSv1)
self.assertEqual(ssl_options['keyfile'], 'file.key')
self.assertEqual(ssl_options['certfile'], 'file.crt')
+
+ def test_uri_set_client_properties(self):
+ cp = {'platform': 'Atari', 'license': 'MIT'}
+ connection = UriConnection(
+ 'amqp://guest:guest@localhost:5672/%2F', lazy=True,
+ client_properties=cp
+ )
+
+ self.assertIsInstance(connection.parameters['client_properties'], dict)
+ self.assertEqual(connection.parameters['client_properties'], cp)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/AMQPStorm-2.7.1/amqpstorm/uri_connection.py
new/AMQPStorm-2.7.2/amqpstorm/uri_connection.py
--- old/AMQPStorm-2.7.1/amqpstorm/uri_connection.py 2019-06-18
06:07:25.000000000 +0200
+++ new/AMQPStorm-2.7.2/amqpstorm/uri_connection.py 2019-12-02
00:51:16.000000000 +0100
@@ -25,7 +25,8 @@
"""
__slots__ = []
- def __init__(self, uri, ssl_options=None, lazy=False):
+ def __init__(self, uri, ssl_options=None, client_properties=None,
+ lazy=False):
"""
:param str uri: AMQP Connection string
@@ -43,10 +44,12 @@
username = urlparse.unquote(parsed_uri.username or 'guest')
password = urlparse.unquote(parsed_uri.password or 'guest')
kwargs = self._parse_uri_options(parsed_uri, use_ssl, ssl_options)
- super(UriConnection, self).__init__(hostname, username,
- password, port,
- lazy=lazy,
- **kwargs)
+ super(UriConnection, self).__init__(
+ hostname, username, password, port,
+ client_properties=client_properties,
+ lazy=lazy,
+ **kwargs
+ )
def _parse_uri_options(self, parsed_uri, use_ssl=False, ssl_options=None):
"""Parse the uri options.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/AMQPStorm-2.7.1/setup.py new/AMQPStorm-2.7.2/setup.py
--- old/AMQPStorm-2.7.1/setup.py 2019-06-18 06:07:25.000000000 +0200
+++ new/AMQPStorm-2.7.2/setup.py 2019-12-02 00:52:06.000000000 +0100
@@ -3,7 +3,7 @@
setup(
name='AMQPStorm',
- version='2.7.1',
+ version='2.7.2',
description='Thread-safe Python RabbitMQ Client & Management library.',
long_description=open('README.rst').read(),
author='Erik Olof Gunnar Andersson',