From ff6c5e95da2cdd9bb267a500b76f529e38c0eefa Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Fri, 5 Sep 2014 10:49:01 -0400 Subject: [PATCH] Add square brackets for ipv6 based hosts Closes-Bug: #1364837 Change-Id: I8f9702377cc049b74622c2db847ffac3ba946b3a --- oslo/messaging/_drivers/impl_qpid.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/oslo/messaging/_drivers/impl_qpid.py b/oslo/messaging/_drivers/impl_qpid.py index f8984da22..421c24182 100644 --- a/oslo/messaging/_drivers/impl_qpid.py +++ b/oslo/messaging/_drivers/impl_qpid.py @@ -478,6 +478,9 @@ class Connection(object): hostname, port = netutils.parse_host_port( adr, default_port=5672) + if ':' in hostname: + hostname = '[' + hostname + ']' + params = { 'host': '%s:%d' % (hostname, port), 'username': self.conf.qpid_username,