From 95cdc0bb6f9d19fd6a76c6071ab2a779659fc352 Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Sun, 24 Jun 2012 12:01:45 +0100 Subject: [PATCH] Fixes .clone() for transports in URI_PASSTHROUGH --- kombu/connection.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kombu/connection.py b/kombu/connection.py index 8f4cc765..03fdc2eb 100644 --- a/kombu/connection.py +++ b/kombu/connection.py @@ -102,14 +102,14 @@ class BrokerConnection(object): 'port': port, 'insist': insist, 'ssl': ssl, 'transport': transport, 'connect_timeout': connect_timeout, 'login_method': login_method} - if hostname and '://' in hostname \ - and transport not in URI_PASSTHROUGH: + if hostname and '://' in hostname: if '+' in hostname[:hostname.index('://')]: # e.g. sqla+mysql://root:masterkey@localhost/ params['transport'], params['hostname'] = hostname.split('+') self.uri_prefix = params['transport'] else: - params.update(parse_url(hostname)) + if transport and transport not in URI_PASSTHROUGH: + params.update(parse_url(hostname)) self._init_params(**params) # backend_cls argument will be removed shortly. @@ -386,10 +386,10 @@ class BrokerConnection(object): transport_cls = self.transport_cls or 'amqp' transport_cls = {AMQP_ALIAS: 'amqp'}.get(transport_cls, transport_cls) D = self.transport.default_connection_params - hostname = self.hostname + hostname = self.hostname or D.get('hostname') if self.uri_prefix: hostname = '%s+%s' % (self.uri_prefix, hostname) - info = (('hostname', hostname or D.get('hostname')), + info = (('hostname', hostname), ('userid', self.userid or D.get('userid')), ('password', self.password or D.get('password')), ('virtual_host', self.virtual_host or D.get('virtual_host')),