Fix for failing services on py3 with kombu driver
Change-Id: I20dc238cabe9991ed8e297c5cf9b062abc45f126 Closes-bug: 1661201
This commit is contained in:
parent
c9ef100219
commit
1562d158a1
@ -15,6 +15,7 @@
|
||||
|
||||
import itertools
|
||||
import random
|
||||
import six
|
||||
|
||||
import oslo_messaging as messaging
|
||||
|
||||
@ -51,7 +52,7 @@ class KombuHosts(object):
|
||||
self._hosts_cycle = itertools.cycle(self._hosts)
|
||||
|
||||
def get_host(self):
|
||||
return self._hosts_cycle.next()
|
||||
return six.next(self._hosts_cycle)
|
||||
|
||||
def get_hosts(self):
|
||||
return self._hosts
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
import itertools
|
||||
from kombu.mixins import ConsumerMixin
|
||||
from six import moves
|
||||
import six
|
||||
import threading
|
||||
|
||||
from oslo_log import log as logging
|
||||
@ -39,7 +39,7 @@ class KombuRPCListener(ConsumerMixin):
|
||||
self._max_sleep_time = 512
|
||||
|
||||
def add_listener(self, correlation_id):
|
||||
self._results[correlation_id] = moves.queue.Queue()
|
||||
self._results[correlation_id] = six.moves.queue.Queue()
|
||||
|
||||
def remove_listener(self, correlation_id):
|
||||
if correlation_id in self._results:
|
||||
@ -101,7 +101,7 @@ class KombuRPCListener(ConsumerMixin):
|
||||
return self._results[correlation_id].get(block=True, timeout=timeout)
|
||||
|
||||
def on_connection_error(self, exc, interval):
|
||||
self.connection = self._connections.next()
|
||||
self.connection = six.next(self._connections)
|
||||
|
||||
LOG.debug("Broker connection failed: %s" % exc)
|
||||
LOG.debug("Sleeping for %s seconds, then retrying connection" %
|
||||
|
Loading…
Reference in New Issue
Block a user