[jenkins-ci PATCH v5 2/5] lcitool: avoid repetition when expanding package mappings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reviewed-by: Andrea Bolognani <abologna@xxxxxxxxxx>
Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 guests/lcitool | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/guests/lcitool b/guests/lcitool
index ec467b7..46af92b 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -541,18 +541,14 @@ class Application:
 
         temp = {}
 
+        keys = ["default", package_format, os_name, os_full]
         # We need to add the base project manually here: the standard
         # machinery hides it because it's an implementation detail
         for project in projects + ["base"]:
             for package in self._projects.get_packages(project):
-                if "default" in mappings[package]:
-                    temp[package] = mappings[package]["default"]
-                if package_format in mappings[package]:
-                    temp[package] = mappings[package][package_format]
-                if os_name in mappings[package]:
-                    temp[package] = mappings[package][os_name]
-                if os_full in mappings[package]:
-                    temp[package] = mappings[package][os_full]
+                for key in keys:
+                    if key in mappings[package]:
+                        temp[package] = mappings[package][key]
 
         pkgs = []
         for item in temp:
-- 
2.20.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux