]> git.pld-linux.org Git - projects/pld-builder.new.git/commitdiff
- cleanup good handling
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Wed, 15 Jul 2009 13:28:01 +0000 (13:28 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    PLD_Builder/rpm_builder.py -> 1.92

PLD_Builder/rpm_builder.py

index cd80e076a0f16c532de5dec96ddc913e04f4a38a..e7f7cf28fa7a60bf5556c9b10ee0fd553fe05e1f 100644 (file)
@@ -57,33 +57,31 @@ def check_skip_build(r, b):
     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:
This page took 0.050331 seconds and 4 git commands to generate.