extras-buildsys/builder builder.py,1.14,1.15

Daniel Williams (dcbw) fedora-extras-commits at redhat.com
Thu Jul 14 19:12:06 UTC 2005


Author: dcbw

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

Modified Files:
	builder.py 
Log Message:
2005-07-14  Dan Williams <dcbw at redhat.com>

    * builder/builder.py
        - Make the builder not hang if you interrupt it in the middle
            of a time.sleep()
        - Fix misdeclaration of log() which caused a traceback in some
            instances

    * server/Builder.py
        - Kill any job the builder is running when the server starts up

    * server/BuildMaster.py
        - Restart interrupted jobs when the server starts up
        - Remove old query queue code that's no longer used

    * server/PackageJob.py
      server/UserInterface.py
        - is_build_job_stage_valid -> is_package_job_stage_valid




Index: builder.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/builder/builder.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- builder.py	13 Jul 2005 19:36:06 -0000	1.14
+++ builder.py	14 Jul 2005 19:12:03 -0000	1.15
@@ -167,7 +167,10 @@
         start_time = time.time()
         mockstatusfile = os.path.join(self._state_dir, 'status')
         while not os.path.exists(mockstatusfile):
-            time.sleep(0.5)
+            try:
+                time.sleep(0.5)
+            except KeyboardInterrupt:
+                pass
             # if mock exited with an error report that error and not
             # the missing status file.
             exit_status = self._pobj.poll()
@@ -239,7 +242,10 @@
                 string = f.read(4)
             except OSError, e:
                 if e.errno == errno.EAGAIN:
-                    time.sleep(0.25)
+                    try:
+                        time.sleep(0.25)
+                    except KeyboardInterrupt:
+                        pass
                     continue
             else:
                 if len(string) < 4:
@@ -467,7 +473,7 @@
         self.localarches = localarches
         self.cur_job = 0
 
-    def log(string):
+    def log(self, string):
         if config_opts['debug']:
             print string
 
@@ -675,7 +681,10 @@
     # Stop running as root
     if drop_privs() == -1:
         http_server.stop()
-        time.sleep(1)
+        try:
+            time.sleep(1)
+        except KeyboardInterrupt:
+            pass
         os._exit(1)
 
     print "Binding to address '%s' with arches: [%s]" % (config_opts['hostname'], string.join(config_opts['arches']))




More information about the fedora-extras-commits mailing list