[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

extras-buildsys/common CommonErrors.py,1.3,1.4



Author: dcbw

Update of /cvs/fedora/extras-buildsys/common
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv6903/common

Modified Files:
	CommonErrors.py 
Log Message:
2005-06-17  Dan Williams <dcbw redhat com>

    * common/CommonErrors.py
        - Oops, "e" isn't an error, its the data.  Treat it as such.

    * server/client_manager.py
        - Trap more errors in BuildClient._update_cur_job()




Index: CommonErrors.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/common/CommonErrors.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CommonErrors.py	19 Jun 2005 04:35:27 -0000	1.3
+++ CommonErrors.py	20 Jun 2005 16:12:46 -0000	1.4
@@ -26,21 +26,20 @@
     # This is a bit complicated by the fact that different versions of
     # M2Crypto & OpenSSL seem to return different error codes for the
     # same type of error
-    if type(e) == type(SSL.SSLError):
-        if e[0] == 104:     # Connection refused
-            return True
-        elif e[0] == 111:   # Connection reset by peer
-            return True
-        elif e[0] == 61:    # Connection refused
-            return True
-        elif e[0] == 54:    # Connection reset by peer
-            return True
-        elif e[0] == "no certificate returned":
-            return True
-        elif e[0] == "wrong version number":
-            return True
-        elif e[0] == "unexpected eof":
-            return True
+     if e[0] == 104:     # Connection refused
+          return True
+     elif e[0] == 111:   # Connection reset by peer
+          return True
+     elif e[0] == 61:    # Connection refused
+          return True
+     elif e[0] == 54:    # Connection reset by peer
+          return True
+     elif e == "no certificate returned":
+          return True
+     elif e == "wrong version number":
+          return True
+     elif e == "unexpected eof":
+          return True
 
     return False
 
@@ -50,12 +49,11 @@
     Identify common network errors that mean we cannot connect to the server
     """
 
-    if type(e) == type(socket.error):
-        if e[0] == 111:     # Connection refused
-            return True
-        elif e[0] == 104:   # Connection reset by peer
-            return True
-        elif e[0] == 61:    # Connection refused
-            return True
+     if e[0] == 111:     # Connection refused
+          return True
+     elif e[0] == 104:   # Connection reset by peer
+          return True
+     elif e[0] == 61:    # Connection refused
+          return True
 
     return False


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]