diff options
author | Ted Ross <tross@apache.org> | 2008-12-03 18:43:16 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2008-12-03 18:43:16 +0000 |
commit | ba8e5b1129ebb83a601574f349db9701b1511809 (patch) | |
tree | 3ed738d603a5c3ac246cdb2b434763d5375e0994 | |
parent | 46cd611c333e71ef4297b47bfa67ed09343191b1 (diff) | |
download | qpid-python-ba8e5b1129ebb83a601574f349db9701b1511809.tar.gz |
QPID-1512 - Catch only connection-related exceptions in qmf console
connection thread
- Added __hash__ method for UUID in qpid.datatypes
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@723008 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-x | python/commands/qpid-config | 2 | ||||
-rwxr-xr-x | python/commands/qpid-route | 2 | ||||
-rw-r--r-- | python/qmf/console.py | 15 | ||||
-rw-r--r-- | python/qpid/datatypes.py | 3 |
4 files changed, 16 insertions, 6 deletions
diff --git a/python/commands/qpid-config b/python/commands/qpid-config index 6bfa6939f1..beec67c826 100755 --- a/python/commands/qpid-config +++ b/python/commands/qpid-config @@ -379,7 +379,7 @@ try: else: Usage () except Exception,e: - print "Failed:", e.args[0] + print "Failed:", e.args sys.exit(1) bm.Disconnect() diff --git a/python/commands/qpid-route b/python/commands/qpid-route index 5733c62a27..e0e655683a 100755 --- a/python/commands/qpid-route +++ b/python/commands/qpid-route @@ -508,7 +508,7 @@ try: Usage() except Exception,e: - print "Failed:", e.args[0] + print "Failed:", e.args sys.exit(1) rm.disconnect() diff --git a/python/qmf/console.py b/python/qmf/console.py index fe329db289..739ccb6b6b 100644 --- a/python/qmf/console.py +++ b/python/qmf/console.py @@ -1191,9 +1191,16 @@ class ManagedConnection(Thread): delay = self.DELAY_MIN finally: self.cv.release() - except: + except socket.error: + if delay < self.DELAY_MAX: + delay *= self.DELAY_FACTOR + except SessionDetached: if delay < self.DELAY_MAX: delay *= self.DELAY_FACTOR + except Closed: + if delay < self.DELAY_MAX: + delay *= self.DELAY_FACTOR + try: self.cv.acquire() self.cv.wait(delay) @@ -1332,13 +1339,13 @@ class Broker: except socket.error, e: self.error = "Socket Error %s - %s" % (e[0], e[1]) - raise Exception(self.error) + raise except Closed, e: self.error = "Connect Failed %d - %s" % (e[0], e[1]) - raise Exception(self.error) + raise except ConnectionFailed, e: self.error = "Connect Failed %d - %s" % (e[0], e[1]) - raise Exception(self.error) + raise def _updateAgent(self, obj): bankKey = (obj.brokerBank, obj.agentBank) diff --git a/python/qpid/datatypes.py b/python/qpid/datatypes.py index 38fc163dd9..eb1f86b0b0 100644 --- a/python/qpid/datatypes.py +++ b/python/qpid/datatypes.py @@ -297,6 +297,9 @@ class UUID: def __repr__(self): return "UUID(%r)" % str(self) + def __hash__(self): + return self.bytes.__hash__() + class timestamp(float): def __new__(cls, obj=None): |