summaryrefslogtreecommitdiff
path: root/python/qmf/console.py
diff options
context:
space:
mode:
authorNuno Santos <nsantos@apache.org>2009-11-12 19:14:49 +0000
committerNuno Santos <nsantos@apache.org>2009-11-12 19:14:49 +0000
commit72366cc49dccdd8645eec396b229b15e9ddee14e (patch)
treefb5fa9ed7f81ef3c5b41bf6acc378510a2362ee5 /python/qmf/console.py
parent48572ba0ee68195b39b932909fcb99a57c9cf826 (diff)
downloadqpid-python-72366cc49dccdd8645eec396b229b15e9ddee14e.tar.gz
replace gethostbyname() with getaddrinfo(), which supports IPv6 addresses and is thread-safe
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@835504 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qmf/console.py')
-rw-r--r--python/qmf/console.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/qmf/console.py b/python/qmf/console.py
index a75c65addc..6326b777e5 100644
--- a/python/qmf/console.py
+++ b/python/qmf/console.py
@@ -97,12 +97,12 @@ class Console:
class BrokerURL(URL):
def __init__(self, text):
URL.__init__(self, text)
- socket.gethostbyname(self.host)
if self.port is None:
if self.scheme == URL.AMQPS:
self.port = 5671
else:
self.port = 5672
+ socket.getaddrinfo(self.host, self.port)[0][4][0]
self.authName = None
self.authPass = None
if self.user:
@@ -114,7 +114,7 @@ class BrokerURL(URL):
return self.host + ":" + str(self.port)
def match(self, host, port):
- return socket.gethostbyname(self.host) == socket.gethostbyname(host) and self.port == port
+ return socket.getaddrinfo(self.host, self.port)[0][4] == socket.gethostbyname(host, port)[0][4]
class Object(object):
""" This class defines a 'proxy' object representing a real managed object on an agent.