[Piuparts-commits] [SCM] piuparts git repository branch, piatti, updated. 0.42-69-g1159ca6

Andreas Beckmann debian at abeckmann.de
Thu May 17 11:45:54 UTC 2012


The following commit has been merged in the piatti branch:
commit 2ba694b8d2b5d3ecace97f0e97ef5f13ac4412ee
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Sun Apr 15 18:28:27 2012 +0200

    slave: skip disabled sections (max-reserved = 0)
    
    skip section without contacting master or fetching package lists
    recheck config after 12 hours
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/debian/changelog b/debian/changelog
index c2bbeed..d6a7bb5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -19,6 +19,7 @@ piuparts (0.44) UNRELEASED; urgency=low
       but allow only one instance per section.
   * piuparts-slave.py:
     - Do not leak the logfile file descriptor to piuparts.
+    - Skip disabled sections (max-reserved = 0).
     - Do not abort if connection to master failed, just skip the section.
     - Implement simple section locking to allow concurrent slave instances.
     - Sections wait before retry 15 minutes after error and one hour if idle.
diff --git a/piuparts-slave.py b/piuparts-slave.py
index 75b6f76..0829531 100644
--- a/piuparts-slave.py
+++ b/piuparts-slave.py
@@ -307,6 +307,11 @@ class Section:
         self._config = Config(section=self._config.section)
         self._config.read(CONFIG_FILE)
 
+        if int(self._config["max-reserved"]) == 0:
+            logging.info("disabled")
+            self._sleep_until = time.time() + 12 * 3600
+            return 0
+
         lock = open(os.path.join(self._slave_directory, "slave.lock"), "we")
         try:
             fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)

-- 
piuparts git repository



More information about the Piuparts-commits mailing list