This patch implements the solution for issue #244.

Currently when we define the list of KojiPkgSpec in text format in a
cartesian configuration file, we do so by creating a python list
instruction that gets evaluated by the installer code.

Taking a better look at it, there's no need to have it that way, and a
simple space separated list of plain text would do just fine. This would
make the koji package specification more in line with other content on
cartersian configuration files, and also simplify it's use, such as
adding a new package specification by doing a += :newpkg:subpkg or any
other valid syntax.

Signed-off-by: Lucas Meneghel Rodrigues <l...@redhat.com>
---
 client/tests/kvm/build.cfg.sample |    2 +-
 client/virt/base_installer.py     |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/client/tests/kvm/build.cfg.sample 
b/client/tests/kvm/build.cfg.sample
index c138a9e..13d44cd 100644
--- a/client/tests/kvm/build.cfg.sample
+++ b/client/tests/kvm/build.cfg.sample
@@ -57,7 +57,7 @@ variants:
 
         # QEMU (KVM) installation from koji/brew
         # koji_qemu_kvm_tag = dist-f15
-        # koji_qemu_kvm_pkgs = 
[':qemu:qemu-common,qemu-img,qemu-kvm,qemu-system-x86,qemu-kvm-tools', 
'seabios', 'vgabios', ':gpxe:gpxe-roms-qemu', ':spice:spice-server']
+        # koji_qemu_kvm_pkgs = 
':qemu:qemu-common,qemu-img,qemu-kvm,qemu-system-x86,qemu-kvm-tools' 'seabios' 
'vgabios' ':gpxe:gpxe-roms-qemu' ':spice:spice-server'
 
         ######################################################################
         # INSTALLERS SELECTION
diff --git a/client/virt/base_installer.py b/client/virt/base_installer.py
index 63bb878..6b0db69 100644
--- a/client/virt/base_installer.py
+++ b/client/virt/base_installer.py
@@ -460,8 +460,8 @@ class KojiInstaller(BaseInstaller):
         self.koji_cmd = params.get("%s_cmd" % self.param_key_prefix, None)
         if self.tag is not None:
             virt_utils.set_default_koji_tag(self.tag)
-        self.koji_pkgs = eval(params.get("%s_pkgs" % self.param_key_prefix,
-                                         "[]"))
+        self.koji_pkgs = params.get("%s_pkgs" % self.param_key_prefix,
+                                    "").split()
         if self.install_debug_info:
             self._expand_koji_pkgs_with_debuginfo()
 
-- 
1.7.9.3

_______________________________________________
Autotest mailing list
Autotest@test.kernel.org
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to