diff options
Diffstat (limited to 'python/qpid')
| -rw-r--r-- | python/qpid/qmfconsole.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/python/qpid/qmfconsole.py b/python/qpid/qmfconsole.py index ed4565dac4..bfa48c7540 100644 --- a/python/qpid/qmfconsole.py +++ b/python/qpid/qmfconsole.py @@ -91,7 +91,8 @@ class BrokerURL: if not match: raise ValueError("'%s' is not a valid broker url" % (text)) user, password, host, port = match.groups() - self.host = socket.gethostbyname(host) + socket.gethostbyname(host) + self.host = host if port: self.port = int(port) else: self.port = 5672 self.authName = user or "guest" @@ -101,6 +102,9 @@ class BrokerURL: def name(self): return self.host + ":" + str(self.port) + def match(self, host, port): + return socket.gethostbyname(self.host) == socket.gethostbyname(host) and self.port == port + class Session: """ An instance of the Session class represents a console session running @@ -784,8 +788,8 @@ class ObjectId: self.first = first self.second = second - def __cmp__(self, other): - if other == None: + def __cmp__(self, other): + if other == None or not isinstance(other, ObjectId) : return 1 if self.first < other.first: return -1 |
