Skip to content

Commit

Permalink
move etcd transport errors to class
Browse files Browse the repository at this point in the history
  • Loading branch information
pawl committed Dec 22, 2021
1 parent b6591e1 commit c217795
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions kombu/transport/etcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,21 +242,22 @@ class Transport(virtual.Transport):
implements = virtual.Transport.implements.extend(
exchange_type=frozenset(['direct']))

if etcd:
connection_errors = (
virtual.Transport.connection_errors + (etcd.EtcdException, )
)

channel_errors = (
virtual.Transport.channel_errors + (etcd.EtcdException, )
)

def __init__(self, *args, **kwargs):
"""Create a new instance of etcd.Transport."""
if etcd is None:
raise ImportError('Missing python-etcd library')

super().__init__(*args, **kwargs)

self.connection_errors = (
virtual.Transport.connection_errors + (etcd.EtcdException, )
)

self.channel_errors = (
virtual.Transport.channel_errors + (etcd.EtcdException, )
)

def verify_connection(self, connection):
"""Verify the connection works."""
port = connection.client.port or self.default_port
Expand Down

0 comments on commit c217795

Please sign in to comment.