[Piuparts-commits] [SCM] piuparts git repository branch, master, updated. eda668423fa87898c59d1075118693714aa5a053

Holger Levsen holger at layer-acht.org
Fri Dec 23 10:26:34 UTC 2011


The following commit has been merged in the master branch:
commit e73b6eb5d1cfe8c39732a5f89c01b37327c78ffb
Author: David Steele <dsteele at gmail.com>
Date:   Thu Nov 24 11:39:10 2011 -0500

    Fix slave idle logic to idle when no work done on the last pass

diff --git a/piuparts-slave.py b/piuparts-slave.py
index ef2971c..5ccf6fe 100644
--- a/piuparts-slave.py
+++ b/piuparts-slave.py
@@ -289,6 +289,8 @@ class Section:
 
         self._slave.close()
 
+        test_count = len(self._slave.get_reserved())
+
         if self._slave.get_reserved():
             self._check_tarball()
             packages_files = {}
@@ -324,6 +326,8 @@ class Section:
                 self._slave.forget_reserved(package_name, version)
             os.chdir(oldcwd)
 
+        return( test_count )
+
 
 def log_name(package, version):
     return "%s_%s.log" % (package, version)
@@ -510,15 +514,15 @@ def main():
         sections.append(section)
 
     while True:
+        test_count = 0
+
         for section in sections:
-            section.run()
-        idle = True
-        for section_name in section_names:
-          if os.listdir(os.path.join(global_config["master-directory"],section_name,"reserved")):
-            idle = False
-        if idle:
-          logging.info("Nothing to do, sleeping for %s seconds." % global_config["idle-sleep"])
-          time.sleep(int(global_config["idle-sleep"]))
+            test_count += section.run()
+
+        if test_count == 0:
+            sleep_time = int(global_config["idle-sleep"])
+            logging.info("Nothing to do, sleeping for %d seconds." % sleep_time)
+            time.sleep( sleep_time )
 
 
 if __name__ == "__main__":

-- 
piuparts git repository



More information about the Piuparts-commits mailing list