diff options
| author | Alan Conway <aconway@apache.org> | 2012-06-12 17:30:10 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2012-06-12 17:30:10 +0000 |
| commit | 727243716a1b65de6fab8d85b3dfdc2ae60e4e86 (patch) | |
| tree | d66527a8bd427e536ff90543e498f0b57d7b9269 /python/qpid | |
| parent | df59a9cf3848ef669089b56bd13b70bff941370f (diff) | |
| download | qpid-python-727243716a1b65de6fab8d85b3dfdc2ae60e4e86.tar.gz | |
NO-JIRA: Fix parsing of C++ URLs in qpid.messaging.util to handle IPv6 addresses.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1349451 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid')
| -rw-r--r-- | python/qpid/messaging/util.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/python/qpid/messaging/util.py b/python/qpid/messaging/util.py index 265cf7d51f..726cfd5172 100644 --- a/python/qpid/messaging/util.py +++ b/python/qpid/messaging/util.py @@ -50,10 +50,13 @@ def set_reconnect_urls(conn, msg): reconnect_urls = [] urls = msg.properties["amq.failover"] for u in urls: + # FIXME aconway 2012-06-12: Nasty hack parsing of the C++ broker's URL format. if u.startswith("amqp:"): - for p in u[5:].split(","): - parts = p.split(":") - host, port = parts[1:3] + for a in u[5:].split(","): + parts = a.split(":") + # Handle IPv6 addresses which have : in the host part. + port = parts[-1] # Last : separated field is port + host = ":".join(parts[1:-1]) # First : separated field is protocol, host is the rest. reconnect_urls.append("%s:%s" % (host, port)) conn.reconnect_urls = reconnect_urls log.warn("set reconnect_urls for conn %s: %s", conn, reconnect_urls) |
