[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.45-56-gf60418b

Andreas Beckmann debian at abeckmann.de
Wed Jul 18 19:28:37 UTC 2012


The following commit has been merged in the develop branch:
commit afe59a0e9a740bcbc74f703de4b82766c1ee22c0
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Thu Jun 21 17:43:02 2012 +0200

    p-s: move precedence evaluation into run()
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/piuparts-slave.py b/piuparts-slave.py
index 2f7de1d..b9301f8 100644
--- a/piuparts-slave.py
+++ b/piuparts-slave.py
@@ -312,10 +312,15 @@ class Section:
     def sleep_until(self):
         return max(self._error_wait_until, self._idle_wait_until)
 
-    def run(self):
+
+    def run(self, precedence=None):
         if time.time() < self.sleep_until():
             return 0
 
+        do_processing = precedence is None or self.precedence() <= precedence
+        if not do_processing:
+            return 0
+
         logging.info("-------------------------------------------")
         logging.info("Running section %s (precedence=%d)" % (self._config.section, self.precedence()))
         self._config = Config(section=self._config.section, defaults_section="global")
@@ -662,11 +667,10 @@ def main():
         precedence = None
 
         for section in sorted(sections, key=lambda section: section.precedence()):
-            if precedence is None or section.precedence() <= precedence:
-                processed = section.run()
-                if processed > 0:
-                    test_count += processed
-                    precedence = section.precedence()
+            processed = section.run(precedence=precedence)
+            if processed > 0:
+                test_count += processed
+                precedence = section.precedence()
 
         if test_count == 0:
             now = time.time()

-- 
piuparts git repository



More information about the Piuparts-commits mailing list