From bd77faf8e5cd2a75f5631cff75558f11c0b7c821 Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Nov 15 2018 12:21:57 +0000 Subject: Pass lists to ODCS in prepare_odcs_compose_with_image_rpms. --- diff --git a/freshmaker/odcsclient.py b/freshmaker/odcsclient.py index 77d7abd..e7955c9 100644 --- a/freshmaker/odcsclient.py +++ b/freshmaker/odcsclient.py @@ -362,6 +362,11 @@ class FreshmakerODCSClient(object): parsed_nvr = kobo.rpmlib.parse_nvra(rpm["nvra"]) packages.add(parsed_nvr["name"]) + # ODCS client expects list and not set for packages/builds, so convert + # them to lists. + builds = list(builds) + packages = list(packages) + if not self.handler.dry_run: with krb_context(): new_compose = create_odcs_client().new_compose( diff --git a/tests/test_odcsclient.py b/tests/test_odcsclient.py index 3ba6d83..b5474f3 100644 --- a/tests/test_odcsclient.py +++ b/tests/test_odcsclient.py @@ -299,8 +299,8 @@ class TestPrepareYumRepo(helpers.ModelsTestCase): # Ensure new_compose is called to request a new compose odcs.new_compose.assert_called_once_with( - '', 'build', builds=set(['avalon-logkit-2.1-14.el7', 'apache-commons-lang-2.6-15.el7']), - flags=['no_deps'], packages=set([u'avalon-logkit', u'apache-commons-lang']), sigkeys=[]) + '', 'build', builds=['avalon-logkit-2.1-14.el7', 'apache-commons-lang-2.6-15.el7'], + flags=['no_deps'], packages=[u'avalon-logkit', u'apache-commons-lang'], sigkeys=[]) def _create_consumer(self): hub = MagicMock()