Skip to content

Commit

Permalink
Fixes for broker_connection()
Browse files Browse the repository at this point in the history
  • Loading branch information
ask committed Sep 19, 2011
1 parent 85234a7 commit 62066c2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions celery/app/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ def broker_connection(self, url=None, *args, **kwargs):
#
# Using kombu URLs, this should be allowed.
#
args = list(args)
conf = self.conf
brokers = conf.BROKERS
alias = conf.BROKER_DEFAULT
Expand All @@ -274,8 +275,10 @@ def broker_connection(self, url=None, *args, **kwargs):
alias = url
else:
args.insert(0, url)
return self.amqp.BrokerConnection(*args,
**dict(brokers[alias], **kwargs))
kwargs = dict(brokers[alias], **kwargs)
if args:
kwargs.pop("hostname", None)
return self.amqp.BrokerConnection(*args, **kwargs)

@contextmanager
def connection_or_acquire(self, connection=None):
Expand Down

0 comments on commit 62066c2

Please sign in to comment.