diff options
author | Kim van der Riet <kpvdr@apache.org> | 2012-08-03 12:13:32 +0000 |
---|---|---|
committer | Kim van der Riet <kpvdr@apache.org> | 2012-08-03 12:13:32 +0000 |
commit | d43d1912b376322e27fdcda551a73f9ff5487972 (patch) | |
tree | ce493e10baa95f44be8beb5778ce51783463196d /python/qpid/messaging | |
parent | 04877fec0c6346edec67072d7f2d247740cf2af5 (diff) | |
download | qpid-python-d43d1912b376322e27fdcda551a73f9ff5487972.tar.gz |
QPID-3858: Updated branch - merged from trunk r.1368650
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1368910 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/messaging')
-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) |