librabbitmq itself now raises if SSL enabled

This commit is contained in:
Ask Solem 2013-04-17 12:36:27 +01:00
parent 2055e495e7
commit cabe1bbe88
3 changed files with 6 additions and 7 deletions

View File

@ -110,8 +110,6 @@ class Connection(object):
>>> conn.release()
"""
SSLNotSupported = exceptions.SSLNotSupported
port = None
virtual_host = '/'
connect_timeout = 5
@ -235,9 +233,6 @@ class Connection(object):
self.transport_cls = transport
self.heartbeat = heartbeat and float(heartbeat)
if ssl and transport == 'librabbitmq':
raise self.SSLNotSupported(transport)
def _debug(self, msg, *args, **kwargs):
fmt = '[Kombu connection:0x%(id)x] %(msg)s'
if self._logger: # pragma: no cover

View File

@ -45,8 +45,6 @@ class ChannelLimitExceeded(LimitExceeded):
"""Maximum number of simultaneous channels exceeded."""
pass
class SSLNotSupported(KombuError):
pass
class StdConnectionError(KombuError):
pass

View File

@ -28,6 +28,10 @@ from . import base
DEFAULT_PORT = 5672
NO_SSL_ERROR = """\
ssl not supported by librabbitmq, please use pyamqp:// or stunnel\
"""
class Message(base.Message):
@ -98,6 +102,8 @@ class Transport(base.Transport):
for name, default_value in self.default_connection_params.items():
if not getattr(conninfo, name, None):
setattr(conninfo, name, default_value)
if conninfo.ssl:
raise NotImplementedError(NO_SSL_ERROR)
conn = self.Connection(host=conninfo.host,
userid=conninfo.userid,
password=conninfo.password,