Merge "Add square brackets for ipv6 based hosts"

This commit is contained in:
Jenkins 2014-09-09 05:31:35 +00:00 committed by Gerrit Code Review
commit 37ed443727

View File

@ -478,6 +478,9 @@ class Connection(object):
hostname, port = netutils.parse_host_port( hostname, port = netutils.parse_host_port(
adr, default_port=5672) adr, default_port=5672)
if ':' in hostname:
hostname = '[' + hostname + ']'
params = { params = {
'host': '%s:%d' % (hostname, port), 'host': '%s:%d' % (hostname, port),
'username': self.conf.qpid_username, 'username': self.conf.qpid_username,