summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-07-17 16:28:14 +0000
committerGerrit Code Review <review@openstack.org>2020-07-17 16:28:14 +0000
commitf988751c5c4a10fddbaac1bfcbdac923ab36e712 (patch)
treea8f3c2c47a74cd74375ae65470a575940533e08a
parentafb035d97185fa9c622bdb9b4c31c71f01160370 (diff)
parent661bdd7f41d1e253e76c9d516019eb6aafe90f15 (diff)
downloadoslo-messaging-f988751c5c4a10fddbaac1bfcbdac923ab36e712.tar.gz
Merge "Drop a python 2 exception management"
-rw-r--r--oslo_messaging/_drivers/impl_rabbit.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/oslo_messaging/_drivers/impl_rabbit.py b/oslo_messaging/_drivers/impl_rabbit.py
index c5c3970..f6ddf8f 100644
--- a/oslo_messaging/_drivers/impl_rabbit.py
+++ b/oslo_messaging/_drivers/impl_rabbit.py
@@ -975,13 +975,6 @@ class Connection(object):
def _heartbeat_thread_job(self):
"""Thread that maintains inactive connections
"""
- # NOTE(hberaud): Python2 doesn't have ConnectionRefusedError
- # defined so to switch connections destination on failure
- # with python2 and python3 we need to wrapp adapt connection refused
- try:
- ConnectRefuseError = ConnectionRefusedError
- except NameError:
- ConnectRefuseError = socket.error
while not self._heartbeat_exit_event.is_set():
with self._connection_lock.for_heartbeat():
@@ -1008,7 +1001,7 @@ class Connection(object):
# ensure_connection for switching the
# connection destination.
except (socket.timeout,
- ConnectRefuseError,
+ ConnectionRefusedError,
OSError,
kombu.exceptions.OperationalError) as exc:
LOG.info("A recoverable connection/channel error "