diff --git a/oslo_messaging/_drivers/impl_rabbit.py b/oslo_messaging/_drivers/impl_rabbit.py index fcfabfdf1..9c44465d0 100644 --- a/oslo_messaging/_drivers/impl_rabbit.py +++ b/oslo_messaging/_drivers/impl_rabbit.py @@ -33,8 +33,6 @@ import kombu.messaging from oslo_config import cfg from oslo_log import log as logging from oslo_utils import netutils -from oslo_utils import versionutils -import pkg_resources import six from six.moves.urllib import parse @@ -1143,18 +1141,6 @@ class Connection(object): with self._connection_lock: self.ensure(method, retry=retry, error_callback=_error_callback) - def _get_expiration(self, timeout): - # NOTE(gcb) kombu accept TTL as seconds instead of millisecond since - # version 3.0.25, so do conversion according to kombu version. - # TODO(gcb) remove this workaround when all supported branches - # with requirement kombu >=3.0.25 - if timeout is not None: - kombu_version = pkg_resources.get_distribution('kombu').version - if not versionutils.is_compatible('3.0.25', kombu_version): - timeout = int(timeout * 1000) - - return timeout - def _publish(self, exchange, msg, routing_key=None, timeout=None): """Publish a message.""" @@ -1174,7 +1160,7 @@ class Connection(object): self._producer.publish(msg, exchange=exchange, routing_key=routing_key, - expiration=self._get_expiration(timeout), + expiration=timeout, compression=self.kombu_compression) def _publish_and_creates_default_queue(self, exchange, msg,