pld-builder.new: PLD_Builder/rpm_builder.py - cleanup good handling

arekm arekm at pld-linux.org
Wed Jul 15 15:28:06 CEST 2009


Author: arekm                        Date: Wed Jul 15 13:28:06 2009 GMT
Module: pld-builder.new               Tag: HEAD
---- Log message:
- cleanup good handling

---- Files affected:
pld-builder.new/PLD_Builder:
   rpm_builder.py (1.91 -> 1.92) 

---- Diffs:

================================================================
Index: pld-builder.new/PLD_Builder/rpm_builder.py
diff -u pld-builder.new/PLD_Builder/rpm_builder.py:1.91 pld-builder.new/PLD_Builder/rpm_builder.py:1.92
--- pld-builder.new/PLD_Builder/rpm_builder.py:1.91	Wed Jul 15 15:03:05 2009
+++ pld-builder.new/PLD_Builder/rpm_builder.py	Wed Jul 15 15:28:01 2009
@@ -57,33 +57,31 @@
     b.log_line("checking if we should skip the build")
     while not good:
         try:
-            good=True
             f = urllib.urlopen(src_url)
+            good = True
         except IOError, error:
             if error[1][0] == 60 or error[1][0] == 110 or error[1][0] == -3 or error[1][0] == 111 or error[1][0] == 61:
-                good=False
                 b.log_line("unable to connect... trying again")
                 continue
             else:
                 return False
-        http_code = f.getcode()
-        if http_code == 200:
+        if f.getcode() == 200:
             f.close()
             return True
+        f.close()
     return False
 
 def fetch_src(r, b):
     src_url = config.control_url + "/srpms/" + r.id + "/" + b.src_rpm
     b.log_line("fetching %s" % src_url)
     start = time.time()
-    good=False
+    good = False
     while not good:
         try:
-            good=True
             f = urllib.urlopen(src_url)
+            good = True
         except IOError, error:
             if error[1][0] == 60 or error[1][0] == 110 or error[1][0] == -3 or error[1][0] == 111 or error[1][0] == 61:
-                good=False
                 b.log_line("unable to connect... trying again")
                 continue
             else:
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/PLD_Builder/rpm_builder.py?r1=1.91&r2=1.92&f=u



More information about the pld-cvs-commit mailing list