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

Andreas Beckmann debian at abeckmann.de
Fri Dec 23 10:25:54 UTC 2011


The following commit has been merged in the master branch:
commit 8dc22d7e17a309dadcf1f2becd7e663def4cea84
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Mon Nov 21 01:25:54 2011 +0100

    check tarball age regularily
    
    Perform the tarball age check (and eventually recreate the tgz)
    every time a section is run.
    Until now long running slaves only updated the tarball at startup.
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/piuparts-slave.py b/piuparts-slave.py
index 917f799..13d300b 100644
--- a/piuparts-slave.py
+++ b/piuparts-slave.py
@@ -235,15 +235,8 @@ class Section:
         if self._config["chroot-tgz"] and not self._config["distro"]:
           logging.info("The option --chroot-tgz needs --distro.")
 
-        tarball = self._config["chroot-tgz"]
-        if tarball:
-            create_or_replace_chroot_tgz(self._config, tarball,
-                      base_tgz_ctrl, self._config["distro"])
-
-        tarball = self._config["upgrade-test-chroot-tgz"]
-        if self._config["upgrade-test-distros"] and tarball: 
-            create_or_replace_chroot_tgz(self._config, tarball,
-                      base_tgz_ctrl, self._config["upgrade-test-distros"].split()[0])
+        self._base_tgz_ctrl = base_tgz_ctrl
+        self._check_tarball()
 
         for rdir in ["new", "pass", "fail"]:
             rdir = os.path.join(self._slave_directory, rdir)
@@ -263,6 +256,17 @@ class Section:
                 os.makedirs(rdir)
         os.chdir(oldcwd)
 
+    def _check_tarball(self):
+        tarball = self._config["chroot-tgz"]
+        if tarball:
+            create_or_replace_chroot_tgz(self._config, tarball,
+                      self._base_tgz_ctrl, self._config["distro"])
+
+        tarball = self._config["upgrade-test-chroot-tgz"]
+        if self._config["upgrade-test-distros"] and tarball:
+            create_or_replace_chroot_tgz(self._config, tarball,
+                      self._base_tgz_ctrl, self._config["upgrade-test-distros"].split()[0])
+
     def run(self):
         logging.info("-------------------------------------------")
         logging.info("Running section " + self._config.section)
@@ -286,6 +290,7 @@ class Section:
         self._slave.close()
 
         if self._slave.get_reserved():
+            self._check_tarball()
             packages_files = {}
             if self._config["distro"]:
                 distros = [self._config["distro"]]

-- 
piuparts git repository



More information about the Piuparts-commits mailing list