[Piuparts-commits] rev 552 - in trunk: . debian

Holger Levsen holger at alioth.debian.org
Wed Dec 9 10:07:11 UTC 2009


Author: holger
Date: 2009-12-09 10:07:08 +0000 (Wed, 09 Dec 2009)
New Revision: 552

Modified:
   trunk/debian/changelog
   trunk/piuparts-slave.py
Log:
piuparts-slave: gracefully deal with upgrade-test-distros and 
upgrade-test-chroot-tgz not being set in the configuration. Thanks to Carl
Chenet and Patrick Schoenfeld for the patch. (Closes: #519192)

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2009-12-09 09:56:14 UTC (rev 551)
+++ trunk/debian/changelog	2009-12-09 10:07:08 UTC (rev 552)
@@ -19,6 +19,9 @@
       In the chroots, APT::Get::AllowUnauthenticated is set accordingly in
       /etc/apt/apt.conf.
   * piuparts-report: report broken symlinks.
+  * piuparts-slave: gracefully deal with upgrade-test-distros and 
+    upgrade-test-chroot-tgz not being set in the configuration. Thanks to Carl
+    Chenet and Patrick Schoenfeld for the patch. (Closes: #519192)
   * Makefile: workaround 559305 by calling a2x twice.   
   * debian/NEWS
 

Modified: trunk/piuparts-slave.py
===================================================================
--- trunk/piuparts-slave.py	2009-12-09 09:56:14 UTC (rev 551)
+++ trunk/piuparts-slave.py	2009-12-09 10:07:08 UTC (rev 552)
@@ -235,8 +235,8 @@
         if not os.path.exists(self._config["chroot-tgz"]):
             create_chroot(self._config, self._config["chroot-tgz"], self._config["distro"])
     
-        if (self._config["upgrade-test-distros"] and not
-            os.path.exists(self._config["upgrade-test-chroot-tgz"])):
+        if (self._config["upgrade-test-distros"] and self._config["upgrade-test-chroot-tgz"]
+            and not os.path.exists(self._config["upgrade-test-chroot-tgz"])):
             create_chroot(self._config, self._config["upgrade-test-chroot-tgz"], 
                         self._config["upgrade-test-distros"].split()[0])
     
@@ -286,7 +286,11 @@
             time.sleep(int(self._idle_sleep))
         else:
             packages_files = {}
-            distros = [self._config["distro"]] + self._config["upgrade-test-distros"].split()
+            if self._config["upgrade-test-distros"]:
+                distros = [self._config["distro"]] + self._config["upgrade-test-distros"].split()
+            else:
+                distros = [config["distro"]]
+
             for distro in distros:
                 if distro not in packages_files:
                     packages_files[distro] = fetch_packages_file(self._config, distro)
@@ -314,14 +318,17 @@
 
 
 def upgrade_testable(config, package, packages_files):
-    distros = config["upgrade-test-distros"].split()
-    if not distros:
-        return False
-    for distro in distros:
-        if not package["Package"] in packages_files[distro]:
+    if config["upgrade-test-distros"]:
+        distros = config["upgrade-test-distros"].split()
+        if not distros:
             return False
-    return True
 
+        for distro in distros:
+            if not package["Package"] in packages_files[distro]:
+                return False
+        return True
+    else:
+        return False
 
 def test_package(config, package, packages_files):
     logging.info("Testing package %s/%s %s" % (config.section, package["Package"], package["Version"]))




More information about the Piuparts-commits mailing list