From 026ba109871acb895d56e0676de3dd095d775c4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Mon, 30 Oct 2017 12:50:44 +0100 Subject: [PATCH] kojiwrapper: Deal with multiple values for image-build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the config for image-build command contains multiple values, they should be joined with commas into a single value. Signed-off-by: Lubomír Sedlář --- pungi/wrappers/kojiwrapper.py | 2 ++ tests/test_koji_wrapper.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pungi/wrappers/kojiwrapper.py b/pungi/wrappers/kojiwrapper.py index 982b3aa2..88d12f1a 100644 --- a/pungi/wrappers/kojiwrapper.py +++ b/pungi/wrappers/kojiwrapper.py @@ -171,6 +171,8 @@ class KojiWrapper(object): for section, opts in config_options.items(): cfg_parser.add_section(section) for option, value in opts.items(): + if isinstance(value, list): + value = ','.join(value) if not isinstance(value, six.string_types): # Python 3 configparser will reject non-string values. value = str(value) diff --git a/tests/test_koji_wrapper.py b/tests/test_koji_wrapper.py index 1a10c9d7..4128a382 100644 --- a/tests/test_koji_wrapper.py +++ b/tests/test_koji_wrapper.py @@ -78,7 +78,7 @@ class KojiWrapperTest(KojiWrapperBaseTestCase): 'target': 'test-target', 'install_tree': '/tmp/test/install_tree', 'arches': 'x86_64', - 'format': 'docker,qcow2', + 'format': ['docker', 'qcow2'], 'kickstart': 'test-kickstart', 'ksurl': 'git://example.com/ks.git', 'distro': 'test-distro',