diff -Nru python-oslo.messaging-9.3.1/AUTHORS python-oslo.messaging-9.5.0/AUTHORS --- python-oslo.messaging-9.3.1/AUTHORS 2019-01-08 13:28:41.000000000 +0000 +++ python-oslo.messaging-9.5.0/AUTHORS 2019-02-26 00:07:24.000000000 +0000 @@ -24,6 +24,7 @@ Chandan Kumar Chang Bo Guo ChangBo Guo(gcb) +Charles Short Chet Burgess Chris Dent Christian Berendt @@ -175,6 +176,7 @@ Zhen Qin Zhi Kun Liu ZhiQiang Fan +ZhijunWei ZhongShengping Zhongyue Luo armando-migliaccio @@ -205,6 +207,7 @@ loooosy lqslan maoshuai +mb melissaml ozamiatin ricolin diff -Nru python-oslo.messaging-9.3.1/ChangeLog python-oslo.messaging-9.5.0/ChangeLog --- python-oslo.messaging-9.3.1/ChangeLog 2019-01-08 13:28:41.000000000 +0000 +++ python-oslo.messaging-9.5.0/ChangeLog 2019-02-26 00:07:24.000000000 +0000 @@ -1,6 +1,21 @@ CHANGES ======= +9.5.0 +----- + +* add python 3.7 unit test job +* Mark telemetry tests nv and remove from gate +* Bump amqp requirement version to >=2.4.1 +* Change python3.5 job to python3.7 job on Stein+ + +9.4.0 +----- + +* Bump amqp requirement version to >= 2.4.0 +* Kafka driver deployment guide +* Update hacking version + 9.3.1 ----- diff -Nru python-oslo.messaging-9.3.1/debian/changelog python-oslo.messaging-9.5.0/debian/changelog --- python-oslo.messaging-9.3.1/debian/changelog 2019-01-30 14:22:39.000000000 +0000 +++ python-oslo.messaging-9.5.0/debian/changelog 2019-03-11 16:03:41.000000000 +0000 @@ -1,3 +1,10 @@ +python-oslo.messaging (9.5.0-0ubuntu1) disco; urgency=medium + + * New upstream release for OpenStack Stein. + * d/control: Align (Build-)Depends with upstream. + + -- James Page Mon, 11 Mar 2019 16:03:41 +0000 + python-oslo.messaging (9.3.1-0ubuntu1) disco; urgency=medium * New upstream release for OpenStack Stein. diff -Nru python-oslo.messaging-9.3.1/debian/control python-oslo.messaging-9.5.0/debian/control --- python-oslo.messaging-9.3.1/debian/control 2019-01-30 14:22:39.000000000 +0000 +++ python-oslo.messaging-9.5.0/debian/control 2019-03-11 16:03:41.000000000 +0000 @@ -19,7 +19,7 @@ python3-sphinx (>= 1.6.2), Build-Depends-Indep: bandit, - python-amqp (>= 2.1.1), + python-amqp (>= 2.4.0), python-cachetools (>= 2.0.0), python-confluent-kafka (>= 0.11.6), python-coverage (>= 4.0), @@ -50,7 +50,7 @@ python-testtools (>= 2.2.0), python-webob (>= 1:1.7.1), python-yaml (>= 3.12), - python3-amqp (>= 2.1.1), + python3-amqp (>= 2.4.0), python3-cachetools (>= 2.0.0), python3-confluent-kafka (>= 0.11.6), python3-coverage (>= 4.0), @@ -92,7 +92,7 @@ Package: python-oslo.messaging Architecture: all Depends: - python-amqp (>= 2.1.1), + python-amqp (>= 2.4.0), python-cachetools (>= 2.0.0), python-debtcollector (>= 1.2.0), python-futurist (>= 1.2.0), @@ -127,7 +127,7 @@ Package: python3-oslo.messaging Architecture: all Depends: - python3-amqp (>= 2.1.1), + python3-amqp (>= 2.4.0), python3-cachetools (>= 2.0.0), python3-debtcollector (>= 1.2.0), python3-futurist (>= 1.2.0), diff -Nru python-oslo.messaging-9.3.1/doc/source/admin/index.rst python-oslo.messaging-9.5.0/doc/source/admin/index.rst --- python-oslo.messaging-9.3.1/doc/source/admin/index.rst 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/doc/source/admin/index.rst 2019-02-26 00:06:23.000000000 +0000 @@ -7,3 +7,4 @@ drivers AMQP1.0 + kafka diff -Nru python-oslo.messaging-9.3.1/doc/source/admin/kafka.rst python-oslo.messaging-9.5.0/doc/source/admin/kafka.rst --- python-oslo.messaging-9.3.1/doc/source/admin/kafka.rst 1970-01-01 00:00:00.000000000 +0000 +++ python-oslo.messaging-9.5.0/doc/source/admin/kafka.rst 2019-02-26 00:06:23.000000000 +0000 @@ -0,0 +1,245 @@ +----------------------------- +Kafka Driver Deployment Guide +----------------------------- + +============ +Introduction +============ + +The Kafka Driver is an experimental messaging transport backend +in *oslo.messaging*. The driver maps the base oslo.messaging +capabilities for notification message exchange onto V2.0 of the +Apache Kafka distributed streaming platform. More detail regarding +the Apache Kafka server is available from the `Apache Kafka website`__. + +__ https://kafka.apache.org/ + +More detail regarding the driver's implementation is available from +the `adding kafka driver specification`_ and the `update kafka driver +specification`_ . + +.. _adding kafka driver specification: https://git.openstack.org/cgit/openstack/oslo-specs/tree/specs/liberty/adding-kafka-support.rst +.. _update kafka driver specification: https://git.openstack.org/cgit/openstack/oslo-specs/tree/specs/queens/update-kafka-support.rst + +======== +Overview +======== + +The Kafka driver **only** supports use for sending and receiving +*oslo.messaging* notifications. Specifically, the Kafka driver +does not support *oslo.messaging* RPC transfers. Communications between +the driver and Kafka server backend uses a `binary protocol over TCP`_ +that defines all APIs as request response message pairs. The Kafka +driver integrates the confluent kafka python client for full +protocol support and utilizes the Producer API to publish notification +messages and the Consumer API for notification listener subscriptions. +The driver is able to work with a single instance of a Kafka server or +a clustered Kafka server deployment. + +.. _binary protocol over TCP: https://kafka.apache.org/protocol.html + +Hybrid Messaging Deployment +--------------------------- + +*Oslo.messaging* provides a mechanism to configure separate messaging +backends for RPC and notification communications. This is supported +through the definition of separate RPC and notification +`transport urls`_ in the service configuration. When the Kafka driver +is deployed for *oslo.messaging* notifications, a separate driver and +messaging backend must be deployed for RPC communications. For these +hybrid messaging configurations, either the `rabbit`_ or `amqp`_ +drivers can be deployed for *oslo.messaging* RPC. + +.. _transport urls: https://docs.openstack.org/oslo.messaging/latest/reference/transport.html +.. _rabbit: https://docs.openstack.org/oslo.messaging/latest/admin/drivers.html#rabbit +.. _amqp: https://docs.openstack.org/oslo.messaging/latest/admin/AMQP1.0.html + +Topics and vhost Support +------------------------ + +The Kafka topic is the feed name to which records are +published. Topics in Kafka are multi-subscriber such that a topic can +have zero, one or many consumers that subscribe to the data written to +it. In *oslo.messaging*, a notification listener subscribes to a topic +in a supplied target that is directly mapped by the driver to the +Kafka topic. The Kafka server architecture does not natively support +vhosts. In order to support the presence of a vhost in the transport +url provided to the driver, the topic created on the Kafka server will +be appended with the virtual host name. This creates a unique topic +per virtual host but **note** there is otherwise no access +control or isolation provided by the Kafka server. + +Listener Pools +-------------- + +The Kafka driver provides support for listener pools. This capability +is realized by mapping the listener pool name to a Kafka server +*consumer group* name. Each record published to a topic will be +delivered to one consumer instance within each subscribing pool +(e.g. *consumer group*). If a listener pool name is not assigned to the +notification listener, a single default *consumer group* will be used by +the Kafka driver and all listeners will be assigned to that +group and the messages will effectively be load balanced across the +competing listener instances. + + +Synchronous Commit +------------------ + +A primary functional difference between a Kafka server and a +classic broker queue is that the offset or position of the +message read from the commit log is controlled by the listener +(e.g. consumer). The driver will advance the offset it maintains +linearly as it reads message records from the server. To ensure that +duplicate messages are not generated during downtime or communication +interruption, the driver will *synchronously* commit the consumed +messages prior to the notification listener dispatch. Due to this, the +driver does not support the re-queue operation and the driver can not +replay messages from a Kafka partition. + +============= +Prerequisites +============= + +In order to run the driver the confluent-kafka python client must be +installed. The Kafka driver integrates a `Python client based on librdkafka`_ +for full protocol support and utilizes the Producer API to publish +notification messages and the Consumer API for notification listener +subscriptions. + +.. _Python client based on librdkafka: https://github.com/confluentinc/confluent-kafka-python + +Source packages for the `confluent-kafka library`_ are available via PyPI. +Since the Kafka driver is an optional extension to *oslo.messaging* +these packages are not installed by default. Use the 'kafka' extras +tag when installing *oslo.messaging* in order to pull in these extra +packages: + +:: + + python -m pip install oslo.messaging[kafka] + + +.. _confluent-kafka library: https://pypi.org/project/confluent-kafka/ + +============= +Configuration +============= + +Transport URL Enable +-------------------- + +In *oslo.messaging*, the transport_url parameters define the OpenStack service +backends for RPC and Notify. The url is of the form:: + + transport://user:pass@host1:port[,hostN:portN]/virtual_host + +Where the transport value specifies the rpc or notification backend as +one of ``amqp``, ``rabbit``, ``kafka``, etc. To specify and enable the +Kafka driver for notifications, in the section +``[oslo_messaging_notifications]`` of the service configuration file, +specify the ``transport_url`` parameter:: + + [oslo_messaging_notifications] + transport_url = kafka://username:password@kafkahostname:9092 + +Note, that if a ``transport_url`` parameter is not specified in the +``[oslo_messaging_notifications]`` section, the ``[DEFAULT]`` +transport_url will be used for both RPC and Notify backends. + +Driver Options +-------------- + +It is recommended that the default configuration options provided by +the Kafka driver be used. The configuration options can be modified +in the ``oslo_messaging_kafka`` section of the service configuration file. + +Notification Listener Options +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +kafka_max_fetch_bytes + Initial maximum number of bytes per topic+partition to request + when fetching messages from the broker. + +kafka_consumer_timeout + Consumer polling interval timeout. + +consumer_group + The default client group identifier. + +enable_auto_commit + Indicator to perform asynchronous consumer message commits. + +max_poll_records + The maximum number of messages to return per consume/poll operation. + +Notifier Options +^^^^^^^^^^^^^^^^ + +producer_batch_timeout + Delay (ms) to wait for messages in the producer queue to + accumulate before constructing message sets to transmit to broker + +producer_batch_size + The maximum number of messages batched into one message set + +Security Options +^^^^^^^^^^^^^^^^ + +security_protocol + The protocol used to communicate with the Kafka brokers. + +sasl_mechanisms + SASL mechanism to use for authentication. Current driver support + is for PLAIN only. + +ssl_cafile + A file containing the trusted Certificate Authority's digital + certificate (in PEM format). This certificate is used to + authenticate the messaging backend. + +================ +DevStack Support +================ + +The plugin for the Kafka *oslo.messaging* driver is supported by +DevStack. As the Kafka driver can only be deployed for notifications, +the plugin supports the deployment of several message bus configurations. +In local.conf ``[localrc]`` section, the `devstack-plugin-kafka`_ +plugin repository must be enabled. For example: + +:: + + [[local|localrc]] + enable_plugin kafka https://git.openstack.org/openstack/devstack-plugin-kafka + + +Set the Kafka and Scala version and location variables if needed for +the configuration + +:: + + KAFKA_VERSION=2.0.0 + KAFKA_BASEURL=http://www.apache.org/dist/kafka + SCALA_VERSION=2.12 + SCALA_BASEURL=http://www.scala-lang.org/riles/archive + +The **RPC_** and **NOTIFY_** variables will define the message bus +configuration that will be used. The hybrid configurations will allow +for the *rabbit* and *amqp* drivers to be used for the RPC transports +while the *kafka* driver will be used for the Notify transport. The +setting of the service variables will select which messaging +intermediary is enabled for the configuration: + ++------------+--------------------+--------------------+ +| | RPC | NOTIFY | +| +-----------+--------+-----------+--------+ +| | SERVICE | PORT | SERVICE | PORT | ++------------+-----------+--------+-----------+--------+ +| Config 1 | rabbit | 5672 | kafka | 9092 | ++------------+-----------+--------+-----------+--------+ +| Config 1 | amqp | 5672 | kafka | 9092 | ++------------+-----------+--------+-----------+--------+ + + +.. _devstack-plugin-kafka: https://github.com/openstack/devstack-plugin-kafka.git diff -Nru python-oslo.messaging-9.3.1/lower-constraints.txt python-oslo.messaging-9.5.0/lower-constraints.txt --- python-oslo.messaging-9.3.1/lower-constraints.txt 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/lower-constraints.txt 2019-02-26 00:06:23.000000000 +0000 @@ -1,5 +1,5 @@ alabaster==0.7.10 -amqp==2.3.0 +amqp==2.4.1 appdirs==1.3.0 Babel==2.3.4 bandit==1.1.0 diff -Nru python-oslo.messaging-9.3.1/oslo_messaging/conffixture.py python-oslo.messaging-9.5.0/oslo_messaging/conffixture.py --- python-oslo.messaging-9.3.1/oslo_messaging/conffixture.py 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo_messaging/conffixture.py 2019-02-26 00:06:23.000000000 +0000 @@ -13,13 +13,13 @@ # License for the specific language governing permissions and limitations # under the License. -__all__ = ['ConfFixture'] - import sys import fixtures from functools import wraps +__all__ = ['ConfFixture'] + def _import_opts(conf, module, opts, group=None): __import__(module) diff -Nru python-oslo.messaging-9.3.1/oslo_messaging/_drivers/amqp1_driver/addressing.py python-oslo.messaging-9.5.0/oslo_messaging/_drivers/amqp1_driver/addressing.py --- python-oslo.messaging-9.3.1/oslo_messaging/_drivers/amqp1_driver/addressing.py 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo_messaging/_drivers/amqp1_driver/addressing.py 2019-02-26 00:06:23.000000000 +0000 @@ -285,8 +285,8 @@ " present.") LOG.warning(w) - if self._mode == 'legacy' or (self._mode == 'dynamic' - and product == 'qpid-cpp'): + if self._mode == 'legacy' or (self._mode == 'dynamic' and + product == 'qpid-cpp'): return LegacyAddresser(self._default_exchange, self._kwargs['legacy_server_prefix'], self._kwargs['legacy_broadcast_prefix'], diff -Nru python-oslo.messaging-9.3.1/oslo_messaging/_drivers/amqp1_driver/controller.py python-oslo.messaging-9.5.0/oslo_messaging/_drivers/amqp1_driver/controller.py --- python-oslo.messaging-9.3.1/oslo_messaging/_drivers/amqp1_driver/controller.py 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo_messaging/_drivers/amqp1_driver/controller.py 2019-02-26 00:06:23.000000000 +0000 @@ -35,11 +35,6 @@ import time import uuid -if hasattr(time, 'monotonic'): - now = time.monotonic -else: - from monotonic import monotonic as now # noqa - import proton import pyngus from six import iteritems @@ -56,6 +51,11 @@ from oslo_messaging.target import Target from oslo_messaging import transport +if hasattr(time, 'monotonic'): + now = time.monotonic +else: + from monotonic import monotonic as now # noqa + LOG = logging.getLogger(__name__) @@ -491,8 +491,8 @@ self._unacked.discard(send_task) if state == Sender._ACCEPTED: send_task._on_ack(Sender._ACCEPTED, info) - elif (state == Sender._RELEASED - or (state == Sender._MODIFIED and + elif (state == Sender._RELEASED or + (state == Sender._MODIFIED and # assuming delivery-failed means in-doubt: not info.get("delivery-failed") and not info.get("undeliverable-here"))): @@ -1337,5 +1337,5 @@ @property def _active(self): # Is the connection up - return (self._socket_connection - and self._socket_connection.pyngus_conn.active) + return (self._socket_connection and + self._socket_connection.pyngus_conn.active) diff -Nru python-oslo.messaging-9.3.1/oslo_messaging/_drivers/amqp1_driver/eventloop.py python-oslo.messaging-9.5.0/oslo_messaging/_drivers/amqp1_driver/eventloop.py --- python-oslo.messaging-9.3.1/oslo_messaging/_drivers/amqp1_driver/eventloop.py 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo_messaging/_drivers/amqp1_driver/eventloop.py 2019-02-26 00:06:23.000000000 +0000 @@ -28,6 +28,7 @@ import logging import math import os +import pyngus import select import socket import threading @@ -39,9 +40,6 @@ else: from monotonic import monotonic as now # noqa -import pyngus - -from oslo_messaging._i18n import _LE, _LI, _LW LOG = logging.getLogger(__name__) @@ -103,7 +101,7 @@ if not addr: key = "%s:%i" % (host.hostname, host.port) error = "Invalid peer address '%s'" % key - LOG.error(_LE("Invalid peer address '%s'"), key) + LOG.error("Invalid peer address '%s'", key) self._handler.socket_error(error) return my_socket = socket.socket(addr[0][0], addr[0][1], addr[0][2]) @@ -114,7 +112,7 @@ except socket.error as e: if e.errno != errno.EINPROGRESS: error = "Socket connect failure '%s'" % str(e) - LOG.error(_LE("Socket connect failure '%s'"), str(e)) + LOG.error("Socket connect failure '%s'", str(e)) self._handler.socket_error(error) return self.socket = my_socket @@ -388,7 +386,7 @@ select.select(readfds, writefds, [], timeout) except select.error as serror: if serror[0] == errno.EINTR: - LOG.warning(_LW("ignoring interrupt from select(): %s"), + LOG.warning("ignoring interrupt from select(): %s", str(serror)) continue raise # assuming fatal... @@ -406,5 +404,5 @@ self._scheduler._process() # run any deferred requests - LOG.info(_LI("eventloop thread exiting, container=%s"), + LOG.info("eventloop thread exiting, container=%s", self._container.name) diff -Nru python-oslo.messaging-9.3.1/oslo_messaging/_drivers/amqpdriver.py python-oslo.messaging-9.5.0/oslo_messaging/_drivers/amqpdriver.py --- python-oslo.messaging-9.3.1/oslo_messaging/_drivers/amqpdriver.py 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo_messaging/_drivers/amqpdriver.py 2019-02-26 00:06:23.000000000 +0000 @@ -13,8 +13,6 @@ # License for the specific language governing permissions and limitations # under the License. -__all__ = ['AMQPDriverBase'] - import logging import threading import time @@ -33,6 +31,8 @@ from oslo_messaging._i18n import _LI from oslo_messaging._i18n import _LW +__all__ = ['AMQPDriverBase'] + LOG = logging.getLogger(__name__) # Minimum/Maximum sleep between a poll and ack/requeue diff -Nru python-oslo.messaging-9.3.1/oslo_messaging/_drivers/impl_kafka.py python-oslo.messaging-9.5.0/oslo_messaging/_drivers/impl_kafka.py --- python-oslo.messaging-9.3.1/oslo_messaging/_drivers/impl_kafka.py 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo_messaging/_drivers/impl_kafka.py 2019-02-26 00:06:23.000000000 +0000 @@ -378,7 +378,7 @@ class KafkaDriver(base.BaseDriver): """Kafka Driver - Note: Current implementation of this driver is experimental. + See :doc:`kafka` for details. """ def __init__(self, conf, url, default_exchange=None, diff -Nru python-oslo.messaging-9.3.1/oslo_messaging/_drivers/impl_rabbit.py python-oslo.messaging-9.5.0/oslo_messaging/_drivers/impl_rabbit.py --- python-oslo.messaging-9.3.1/oslo_messaging/_drivers/impl_rabbit.py 2019-01-08 13:28:01.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo_messaging/_drivers/impl_rabbit.py 2019-02-26 00:06:23.000000000 +0000 @@ -1094,9 +1094,9 @@ info = dict([(k, ci.get(k)) for k in ['hostname', 'port', 'transport']]) client_port = None - if (not conn_error and self.channel - and hasattr(self.channel.connection, 'sock') - and self.channel.connection.sock): + if (not conn_error and self.channel and + hasattr(self.channel.connection, 'sock') and + self.channel.connection.sock): client_port = self.channel.connection.sock.getsockname()[1] info.update({'client_port': client_port, 'connection_id': self.connection_id}) diff -Nru python-oslo.messaging-9.3.1/oslo_messaging/exceptions.py python-oslo.messaging-9.5.0/oslo_messaging/exceptions.py --- python-oslo.messaging-9.3.1/oslo_messaging/exceptions.py 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo_messaging/exceptions.py 2019-02-26 00:06:23.000000000 +0000 @@ -13,11 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. +import six + __all__ = ['MessagingException', 'MessagingTimeout', 'MessageDeliveryFailure', 'InvalidTarget'] -import six - class MessagingException(Exception): """Base class for exceptions.""" diff -Nru python-oslo.messaging-9.3.1/oslo_messaging/hacking/checks.py python-oslo.messaging-9.5.0/oslo_messaging/hacking/checks.py --- python-oslo.messaging-9.3.1/oslo_messaging/hacking/checks.py 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo_messaging/hacking/checks.py 2019-02-26 00:06:23.000000000 +0000 @@ -157,8 +157,8 @@ """Return the fully qualified name or a Name or Attribute.""" if isinstance(node, ast.Name): return node.id - elif (isinstance(node, ast.Attribute) - and isinstance(node.value, (ast.Name, ast.Attribute))): + elif (isinstance(node, ast.Attribute) and + isinstance(node.value, (ast.Name, ast.Attribute))): method_name = node.attr obj_name = self._find_name(node.value) if obj_name is None: @@ -189,8 +189,8 @@ """ attr_node_types = (ast.Name, ast.Attribute) - if (len(node.targets) != 1 - or not isinstance(node.targets[0], attr_node_types)): + if (len(node.targets) != 1 or + not isinstance(node.targets[0], attr_node_types)): # say no to: "x, y = ..." return super(CheckForLoggingIssues, self).generic_visit(node) @@ -211,13 +211,13 @@ return super(CheckForLoggingIssues, self).generic_visit(node) # is this a call to an i18n function? - if (isinstance(node.value.func, ast.Name) - and node.value.func.id in self.i18n_names): + if (isinstance(node.value.func, ast.Name) and + node.value.func.id in self.i18n_names): self.assignments[target_name] = node.value.func.id return super(CheckForLoggingIssues, self).generic_visit(node) - if (not isinstance(node.value.func, ast.Attribute) - or not isinstance(node.value.func.value, attr_node_types)): + if (not isinstance(node.value.func, ast.Attribute) or + not isinstance(node.value.func.value, attr_node_types)): # function must be an attribute on an object like # logging.getLogger return super(CheckForLoggingIssues, self).generic_visit(node) @@ -225,8 +225,8 @@ object_name = self._find_name(node.value.func.value) func_name = node.value.func.attr - if (object_name in self.logger_module_names - and func_name == 'getLogger'): + if (object_name in self.logger_module_names and + func_name == 'getLogger'): self.logger_names.append(target_name) return super(CheckForLoggingIssues, self).generic_visit(node) @@ -250,8 +250,8 @@ self.add_error(msg, message=self.USING_DEPRECATED_WARN) # must be a logger instance and one of the support logging methods - if (obj_name not in self.logger_names - or method_name not in self.TRANS_HELPER_MAP): + if (obj_name not in self.logger_names or + method_name not in self.TRANS_HELPER_MAP): return super(CheckForLoggingIssues, self).generic_visit(node) # the call must have arguments @@ -269,15 +269,15 @@ msg = node.args[0] # first arg to a logging method is the msg # if first arg is a call to a i18n name - if (isinstance(msg, ast.Call) - and isinstance(msg.func, ast.Name) - and msg.func.id in self.i18n_names): + if (isinstance(msg, ast.Call) and + isinstance(msg.func, ast.Name) and + msg.func.id in self.i18n_names): self.add_error(msg, message=self.DEBUG_CHECK_DESC) # if the first arg is a reference to a i18n call - elif (isinstance(msg, ast.Name) - and msg.id in self.assignments - and not self._is_raised_later(node, msg.id)): + elif (isinstance(msg, ast.Name) and + msg.id in self.assignments and + not self._is_raised_later(node, msg.id)): self.add_error(msg, message=self.DEBUG_CHECK_DESC) def _process_non_debug(self, node, method_name): @@ -321,11 +321,11 @@ return helper_method_name = self.TRANS_HELPER_MAP[method_name] - if (self.assignments[msg.id] != helper_method_name - and not self._is_raised_later(node, msg.id)): + if (self.assignments[msg.id] != helper_method_name and + not self._is_raised_later(node, msg.id)): self.add_error(msg, message=self.NONDEBUG_CHECK_DESC) - elif (self.assignments[msg.id] == helper_method_name - and self._is_raised_later(node, msg.id)): + elif (self.assignments[msg.id] == helper_method_name and + self._is_raised_later(node, msg.id)): self.add_error(msg, message=self.EXCESS_HELPER_CHECK_DESC) def _is_raised_later(self, node, name): diff -Nru python-oslo.messaging-9.3.1/oslo_messaging/opts.py python-oslo.messaging-9.5.0/oslo_messaging/opts.py --- python-oslo.messaging-9.3.1/oslo_messaging/opts.py 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo_messaging/opts.py 2019-02-26 00:06:23.000000000 +0000 @@ -13,10 +13,6 @@ # License for the specific language governing permissions and limitations # under the License. -__all__ = [ - 'list_opts' -] - import copy import itertools @@ -30,6 +26,9 @@ from oslo_messaging import server from oslo_messaging import transport +__all__ = [ + 'list_opts' +] _global_opt_lists = [ drivers_base.base_opts, diff -Nru python-oslo.messaging-9.3.1/oslo_messaging/rpc/client.py python-oslo.messaging-9.5.0/oslo_messaging/rpc/client.py --- python-oslo.messaging-9.3.1/oslo_messaging/rpc/client.py 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo_messaging/rpc/client.py 2019-02-26 00:06:23.000000000 +0000 @@ -16,13 +16,6 @@ # License for the specific language governing permissions and limitations # under the License. -__all__ = [ - 'ClientSendError', - 'RPCClient', - 'RPCVersionCapError', - 'RemoteError', -] - import abc import logging @@ -35,6 +28,12 @@ from oslo_messaging import serializer as msg_serializer from oslo_messaging import transport as msg_transport +__all__ = [ + 'ClientSendError', + 'RPCClient', + 'RPCVersionCapError', + 'RemoteError', +] LOG = logging.getLogger(__name__) diff -Nru python-oslo.messaging-9.3.1/oslo_messaging/rpc/dispatcher.py python-oslo.messaging-9.5.0/oslo_messaging/rpc/dispatcher.py --- python-oslo.messaging-9.3.1/oslo_messaging/rpc/dispatcher.py 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo_messaging/rpc/dispatcher.py 2019-02-26 00:06:23.000000000 +0000 @@ -16,18 +16,6 @@ # License for the specific language governing permissions and limitations # under the License. -__all__ = [ - 'NoSuchMethod', - 'RPCAccessPolicyBase', - 'LegacyRPCAccessPolicy', - 'DefaultRPCAccessPolicy', - 'ExplicitRPCAccessPolicy', - 'RPCDispatcher', - 'RPCDispatcherError', - 'UnsupportedVersion', - 'ExpectedException', -] - from abc import ABCMeta from abc import abstractmethod import logging @@ -42,6 +30,18 @@ from oslo_messaging import server as msg_server from oslo_messaging import target as msg_target +__all__ = [ + 'NoSuchMethod', + 'RPCAccessPolicyBase', + 'LegacyRPCAccessPolicy', + 'DefaultRPCAccessPolicy', + 'ExplicitRPCAccessPolicy', + 'RPCDispatcher', + 'RPCDispatcherError', + 'UnsupportedVersion', + 'ExpectedException', +] + LOG = logging.getLogger(__name__) diff -Nru python-oslo.messaging-9.3.1/oslo_messaging/rpc/server.py python-oslo.messaging-9.5.0/oslo_messaging/rpc/server.py --- python-oslo.messaging-9.3.1/oslo_messaging/rpc/server.py 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo_messaging/rpc/server.py 2019-02-26 00:06:23.000000000 +0000 @@ -121,12 +121,6 @@ """ -__all__ = [ - 'get_rpc_server', - 'expected_exceptions', - 'expose' -] - import logging import sys @@ -135,6 +129,12 @@ from oslo_messaging import server as msg_server from oslo_messaging import transport as msg_transport +__all__ = [ + 'get_rpc_server', + 'expected_exceptions', + 'expose' +] + LOG = logging.getLogger(__name__) diff -Nru python-oslo.messaging-9.3.1/oslo_messaging/rpc/transport.py python-oslo.messaging-9.5.0/oslo_messaging/rpc/transport.py --- python-oslo.messaging-9.3.1/oslo_messaging/rpc/transport.py 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo_messaging/rpc/transport.py 2019-02-26 00:06:23.000000000 +0000 @@ -13,12 +13,13 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. + +from oslo_messaging import transport as msg_transport + __all__ = [ 'get_rpc_transport' ] -from oslo_messaging import transport as msg_transport - def get_rpc_transport(conf, url=None, allowed_remote_exmods=None): diff -Nru python-oslo.messaging-9.3.1/oslo_messaging/serializer.py python-oslo.messaging-9.5.0/oslo_messaging/serializer.py --- python-oslo.messaging-9.3.1/oslo_messaging/serializer.py 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo_messaging/serializer.py 2019-02-26 00:06:23.000000000 +0000 @@ -12,8 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. -__all__ = ['Serializer', 'NoOpSerializer', 'JsonPayloadSerializer'] - """Provides the definition of a message serialization handler""" import abc @@ -21,6 +19,8 @@ from oslo_serialization import jsonutils import six +__all__ = ['Serializer', 'NoOpSerializer', 'JsonPayloadSerializer'] + @six.add_metaclass(abc.ABCMeta) class Serializer(object): diff -Nru python-oslo.messaging-9.3.1/oslo_messaging/server.py python-oslo.messaging-9.5.0/oslo_messaging/server.py --- python-oslo.messaging-9.3.1/oslo_messaging/server.py 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo_messaging/server.py 2019-02-26 00:06:23.000000000 +0000 @@ -16,13 +16,6 @@ # License for the specific language governing permissions and limitations # under the License. -__all__ = [ - 'ExecutorLoadFailure', - 'MessageHandlingServer', - 'MessagingServerError', - 'ServerListenError', -] - import abc import functools import inspect @@ -42,6 +35,13 @@ from oslo_messaging._i18n import _LW from oslo_messaging import exceptions +__all__ = [ + 'ExecutorLoadFailure', + 'MessageHandlingServer', + 'MessagingServerError', + 'ServerListenError', +] + LOG = logging.getLogger(__name__) # The default number of seconds of waiting after which we will emit a log diff -Nru python-oslo.messaging-9.3.1/oslo_messaging/tests/drivers/test_amqp_driver.py python-oslo.messaging-9.5.0/oslo_messaging/tests/drivers/test_amqp_driver.py --- python-oslo.messaging-9.3.1/oslo_messaging/tests/drivers/test_amqp_driver.py 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo_messaging/tests/drivers/test_amqp_driver.py 2019-02-26 00:06:23.000000000 +0000 @@ -51,8 +51,8 @@ # The Cyrus-based SASL tests can only be run if the installed version of proton # has been built with Cyrus SASL support. _proton = importutils.try_import("proton") -CYRUS_ENABLED = (pyngus and pyngus.VERSION >= (2, 0, 0) and _proton - and getattr(_proton.SASL, "extended", lambda: False)()) +CYRUS_ENABLED = (pyngus and pyngus.VERSION >= (2, 0, 0) and _proton and + getattr(_proton.SASL, "extended", lambda: False)()) # same with SSL # SSL_ENABLED = (_proton and getattr(_proton.SSL, "present", lambda: False)()) SSL_ENABLED = False @@ -1305,10 +1305,10 @@ s1_payload = [m.message.get('msg') for m in rl[0].get_messages()] s2_payload = [m.message.get('msg') for m in rl[1].get_messages()] - self.assertTrue("Server1" in s1_payload - and "Server2" not in s1_payload) - self.assertTrue("Server2" in s2_payload - and "Server1" not in s2_payload) + self.assertTrue("Server1" in s1_payload and + "Server2" not in s1_payload) + self.assertTrue("Server2" in s2_payload and + "Server1" not in s2_payload) self.assertEqual(s1_payload.count("Fanout"), 1) self.assertEqual(s2_payload.count("Fanout"), 1) self.assertEqual((s1_payload + s2_payload).count("Anycast1"), 1) diff -Nru python-oslo.messaging-9.3.1/oslo_messaging/tests/functional/test_functional.py python-oslo.messaging-9.5.0/oslo_messaging/tests/functional/test_functional.py --- python-oslo.messaging-9.3.1/oslo_messaging/tests/functional/test_functional.py 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo_messaging/tests/functional/test_functional.py 2019-02-26 00:06:23.000000000 +0000 @@ -153,8 +153,8 @@ self.assertEqual(10, server.endpoint.ival) def test_monitor_long_call(self): - if not (self.url.startswith("rabbit://") - or self.url.startswith("amqp://")): + if not (self.url.startswith("rabbit://") or + self.url.startswith("amqp://")): self.skipTest("backend does not support call monitoring") transport = self.useFixture(utils.RPCTransportFixture(self.conf, diff -Nru python-oslo.messaging-9.3.1/oslo_messaging/transport.py python-oslo.messaging-9.5.0/oslo_messaging/transport.py --- python-oslo.messaging-9.3.1/oslo_messaging/transport.py 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo_messaging/transport.py 2019-02-26 00:06:23.000000000 +0000 @@ -17,16 +17,6 @@ # License for the specific language governing permissions and limitations # under the License. -__all__ = [ - 'DriverLoadFailure', - 'InvalidTransportURL', - 'Transport', - 'TransportHost', - 'TransportURL', - 'get_transport', - 'set_transport_defaults', -] - import logging from debtcollector import removals @@ -38,6 +28,16 @@ from oslo_messaging._i18n import _LW from oslo_messaging import exceptions +__all__ = [ + 'DriverLoadFailure', + 'InvalidTransportURL', + 'Transport', + 'TransportHost', + 'TransportURL', + 'get_transport', + 'set_transport_defaults', +] + LOG = logging.getLogger(__name__) _transport_opts = [ diff -Nru python-oslo.messaging-9.3.1/oslo.messaging.egg-info/pbr.json python-oslo.messaging-9.5.0/oslo.messaging.egg-info/pbr.json --- python-oslo.messaging-9.3.1/oslo.messaging.egg-info/pbr.json 2019-01-08 13:28:41.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo.messaging.egg-info/pbr.json 2019-02-26 00:07:24.000000000 +0000 @@ -1 +1 @@ -{"git_version": "344ec5e", "is_release": true} \ No newline at end of file +{"git_version": "472d483", "is_release": true} \ No newline at end of file diff -Nru python-oslo.messaging-9.3.1/oslo.messaging.egg-info/PKG-INFO python-oslo.messaging-9.5.0/oslo.messaging.egg-info/PKG-INFO --- python-oslo.messaging-9.3.1/oslo.messaging.egg-info/PKG-INFO 2019-01-08 13:28:41.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo.messaging.egg-info/PKG-INFO 2019-02-26 00:07:24.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: oslo.messaging -Version: 9.3.1 +Version: 9.5.0 Summary: Oslo Messaging API Home-page: https://docs.openstack.org/oslo.messaging/latest/ Author: OpenStack @@ -47,6 +47,6 @@ Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 -Provides-Extra: kafka Provides-Extra: test Provides-Extra: amqp1 +Provides-Extra: kafka diff -Nru python-oslo.messaging-9.3.1/oslo.messaging.egg-info/requires.txt python-oslo.messaging-9.5.0/oslo.messaging.egg-info/requires.txt --- python-oslo.messaging-9.3.1/oslo.messaging.egg-info/requires.txt 2019-01-08 13:28:41.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo.messaging.egg-info/requires.txt 2019-02-26 00:07:24.000000000 +0000 @@ -12,7 +12,7 @@ cachetools>=2.0.0 WebOb>=1.7.1 PyYAML>=3.12 -amqp>=2.3.0 +amqp>=2.4.1 kombu!=4.0.2,>=4.0.0 oslo.middleware>=3.31.0 @@ -26,7 +26,7 @@ confluent-kafka>=0.11.6 [test] -hacking!=0.13.0,<0.14,>=0.12.0 +hacking<1.2.0,>=1.1.0 fixtures>=3.0.0 mock>=2.0.0 stestr>=2.0.0 diff -Nru python-oslo.messaging-9.3.1/oslo.messaging.egg-info/SOURCES.txt python-oslo.messaging-9.5.0/oslo.messaging.egg-info/SOURCES.txt --- python-oslo.messaging-9.3.1/oslo.messaging.egg-info/SOURCES.txt 2019-01-08 13:28:42.000000000 +0000 +++ python-oslo.messaging-9.5.0/oslo.messaging.egg-info/SOURCES.txt 2019-02-26 00:07:24.000000000 +0000 @@ -22,6 +22,7 @@ doc/source/admin/AMQP1.0.rst doc/source/admin/drivers.rst doc/source/admin/index.rst +doc/source/admin/kafka.rst doc/source/configuration/conffixture.rst doc/source/configuration/index.rst doc/source/configuration/opts.rst @@ -148,6 +149,7 @@ releasenotes/notes/RPC-call-monitoring-7977f047d069769a.yaml releasenotes/notes/add_reno-3b4ae0789e9c45b4.yaml releasenotes/notes/blocking-executor-deprecated-895146c1c3bf2f51.yaml +releasenotes/notes/bump-amqp-version-due-to-tls-issue-e877b152eb101c15.yaml releasenotes/notes/connection_ttl-2cf0fe6e1ab8c73c.yaml releasenotes/notes/deprecate-ZeroMQ-driver-a8af25aaba867c5b.yaml releasenotes/notes/fix-access_policy-deafult-a6954a147cb002b0.yaml diff -Nru python-oslo.messaging-9.3.1/PKG-INFO python-oslo.messaging-9.5.0/PKG-INFO --- python-oslo.messaging-9.3.1/PKG-INFO 2019-01-08 13:28:42.000000000 +0000 +++ python-oslo.messaging-9.5.0/PKG-INFO 2019-02-26 00:07:24.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: oslo.messaging -Version: 9.3.1 +Version: 9.5.0 Summary: Oslo Messaging API Home-page: https://docs.openstack.org/oslo.messaging/latest/ Author: OpenStack @@ -47,6 +47,6 @@ Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 -Provides-Extra: kafka Provides-Extra: test Provides-Extra: amqp1 +Provides-Extra: kafka diff -Nru python-oslo.messaging-9.3.1/releasenotes/notes/bump-amqp-version-due-to-tls-issue-e877b152eb101c15.yaml python-oslo.messaging-9.5.0/releasenotes/notes/bump-amqp-version-due-to-tls-issue-e877b152eb101c15.yaml --- python-oslo.messaging-9.3.1/releasenotes/notes/bump-amqp-version-due-to-tls-issue-e877b152eb101c15.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-oslo.messaging-9.5.0/releasenotes/notes/bump-amqp-version-due-to-tls-issue-e877b152eb101c15.yaml 2019-02-26 00:06:23.000000000 +0000 @@ -0,0 +1,16 @@ +--- +critical: + - | + In combination with amqp<=2.4.0, ``oslo.messaging`` was unreliable + when configured with TLS (as is generally recommended). Users would + see frequent errors such as this:: + + MessagingTimeout: Timed out waiting for a reply to message ID ae039d1695984addbfaaef032ce4fda3 + + Such issues would typically lead to downstream service timeouts, + with no recourse available other than disabling TLS altogether + (see `bug 1800957 + `_). + + The underlying issue is fixed in amqp version 2.4.1, which is now + the minimum version that ``oslo.messaging`` requires. diff -Nru python-oslo.messaging-9.3.1/requirements.txt python-oslo.messaging-9.5.0/requirements.txt --- python-oslo.messaging-9.3.1/requirements.txt 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/requirements.txt 2019-02-26 00:06:23.000000000 +0000 @@ -26,7 +26,7 @@ # rabbit driver is the default # we set the amqp version to ensure heartbeat works -amqp>=2.3.0 # BSD +amqp>=2.4.1 # BSD kombu!=4.0.2,>=4.0.0 # BSD # middleware diff -Nru python-oslo.messaging-9.3.1/test-requirements.txt python-oslo.messaging-9.5.0/test-requirements.txt --- python-oslo.messaging-9.3.1/test-requirements.txt 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/test-requirements.txt 2019-02-26 00:06:23.000000000 +0000 @@ -3,7 +3,7 @@ # process, which may cause wedges in the gate later. # Hacking already pins down pep8, pyflakes and flake8 -hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 +hacking>=1.1.0,<1.2.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD mock>=2.0.0 # BSD diff -Nru python-oslo.messaging-9.3.1/tools/simulator.py python-oslo.messaging-9.5.0/tools/simulator.py --- python-oslo.messaging-9.3.1/tools/simulator.py 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/tools/simulator.py 2019-02-26 00:06:23.000000000 +0000 @@ -10,8 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -import eventlet -eventlet.monkey_patch() +import eventlet # noqa +eventlet.monkey_patch() # noqa import argparse import bisect diff -Nru python-oslo.messaging-9.3.1/tox.ini python-oslo.messaging-9.5.0/tox.ini --- python-oslo.messaging-9.3.1/tox.ini 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/tox.ini 2019-02-26 00:06:23.000000000 +0000 @@ -1,6 +1,6 @@ [tox] minversion = 2.0 -envlist = py35,py27,pep8 +envlist = py37,py27,pep8 [testenv] setenv = @@ -99,9 +99,11 @@ commands = bandit -r oslo_messaging -x tests -n5 [flake8] +# E731 skipped as assign a lambda expression + show-source = True enable-extensions = H203,H106 -ignore = H405 +ignore = E731,H405 exclude = .tox,dist,doc,*.egg,build,__init__.py [hacking] diff -Nru python-oslo.messaging-9.3.1/.zuul.yaml python-oslo.messaging-9.5.0/.zuul.yaml --- python-oslo.messaging-9.3.1/.zuul.yaml 2019-01-08 13:27:56.000000000 +0000 +++ python-oslo.messaging-9.5.0/.zuul.yaml 2019-02-26 00:06:23.000000000 +0000 @@ -220,8 +220,8 @@ - openstack-cover-jobs - openstack-lower-constraints-jobs - openstack-python-jobs - - openstack-python35-jobs - openstack-python36-jobs + - openstack-python37-jobs - periodic-stable-jobs - publish-openstack-docs-pti - release-notes-jobs-python3 @@ -254,7 +254,8 @@ - oslo.messaging-src-grenade-dsvm-multinode: voting: false - - oslo.messaging-telemetry-dsvm-integration-rabbit + - oslo.messaging-telemetry-dsvm-integration-rabbit: + voting: false - oslo.messaging-telemetry-dsvm-integration-amqp1: voting: false - oslo.messaging-telemetry-dsvm-integration-kafka: @@ -264,4 +265,3 @@ jobs: - oslo.messaging-tox-py27-func-rabbit - oslo.messaging-src-dsvm-full-rabbit - - oslo.messaging-telemetry-dsvm-integration-rabbit