kojiwrapper: Deal with multiple values for image-build

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ář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2017-10-30 12:50:44 +01:00
parent 333045fb87
commit 026ba10987
2 changed files with 3 additions and 1 deletions

View File

@ -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)

View File

@ -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',