Author: tross
Date: Wed Dec  3 10:43:16 2008
New Revision: 723008

URL: http://svn.apache.org/viewvc?rev=723008&view=rev
Log:
QPID-1512 - Catch only connection-related exceptions in qmf console
            connection thread
          - Added __hash__ method for UUID in qpid.datatypes

Modified:
    incubator/qpid/trunk/qpid/python/commands/qpid-config
    incubator/qpid/trunk/qpid/python/commands/qpid-route
    incubator/qpid/trunk/qpid/python/qmf/console.py
    incubator/qpid/trunk/qpid/python/qpid/datatypes.py

Modified: incubator/qpid/trunk/qpid/python/commands/qpid-config
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/commands/qpid-config?rev=723008&r1=723007&r2=723008&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/commands/qpid-config (original)
+++ incubator/qpid/trunk/qpid/python/commands/qpid-config Wed Dec  3 10:43:16 
2008
@@ -379,7 +379,7 @@
         else:
             Usage ()
 except Exception,e:
-    print "Failed:", e.args[0]
+    print "Failed:", e.args
     sys.exit(1)
 
 bm.Disconnect()

Modified: incubator/qpid/trunk/qpid/python/commands/qpid-route
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/commands/qpid-route?rev=723008&r1=723007&r2=723008&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/commands/qpid-route (original)
+++ incubator/qpid/trunk/qpid/python/commands/qpid-route Wed Dec  3 10:43:16 
2008
@@ -508,7 +508,7 @@
             Usage()
 
 except Exception,e:
-    print "Failed:", e.args[0]
+    print "Failed:", e.args
     sys.exit(1)
 
 rm.disconnect()

Modified: incubator/qpid/trunk/qpid/python/qmf/console.py
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/qmf/console.py?rev=723008&r1=723007&r2=723008&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/qmf/console.py (original)
+++ incubator/qpid/trunk/qpid/python/qmf/console.py Wed Dec  3 10:43:16 2008
@@ -1191,9 +1191,16 @@
           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 @@
 
     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)

Modified: incubator/qpid/trunk/qpid/python/qpid/datatypes.py
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/qpid/datatypes.py?rev=723008&r1=723007&r2=723008&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/qpid/datatypes.py (original)
+++ incubator/qpid/trunk/qpid/python/qpid/datatypes.py Wed Dec  3 10:43:16 2008
@@ -297,6 +297,9 @@
   def __repr__(self):
     return "UUID(%r)" % str(self)
 
+  def __hash__(self):
+    return self.bytes.__hash__()
+
 class timestamp(float):
 
   def __new__(cls, obj=None):


Reply via email to