Fix wrong condition when reusing old gather phase results.
When list is used in gather_lookaside_repos, the Pungi currently fails with an exception. This is caused by inverted condition in the code which tries to filter-out the lookaside repos generated during the Pungin execution pointing to different compose variants. Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
This commit is contained in:
parent
27a825de48
commit
4623536b24
@ -238,7 +238,7 @@ def reuse_old_gather_packages(compose, arch, variant, package_sets):
|
|||||||
# The gather_lookaside_repos config allows setting multiple repourls
|
# The gather_lookaside_repos config allows setting multiple repourls
|
||||||
# using list, but `_update_config` always uses strings. Therefore we
|
# using list, but `_update_config` always uses strings. Therefore we
|
||||||
# only try to filter out string_types.
|
# only try to filter out string_types.
|
||||||
if isinstance(repourl, six.string_types):
|
if not isinstance(repourl, six.string_types):
|
||||||
continue
|
continue
|
||||||
if not repourl.startswith(compose.topdir):
|
if not repourl.startswith(compose.topdir):
|
||||||
per_arch_repos_to_compare[arch] = repourl
|
per_arch_repos_to_compare[arch] = repourl
|
||||||
|
@ -1236,6 +1236,26 @@ class TestReuseOldGatherPackages(helpers.PungiTestCase):
|
|||||||
)
|
)
|
||||||
self.assertEqual(result, None)
|
self.assertEqual(result, None)
|
||||||
|
|
||||||
|
@mock.patch("pungi.phases.gather.load_old_gather_result")
|
||||||
|
@mock.patch("pungi.phases.gather.load_old_compose_config")
|
||||||
|
def test_reuse_update_gather_lookaside_repos_different_initial_repos_list(
|
||||||
|
self, load_old_compose_config, load_old_gather_result
|
||||||
|
):
|
||||||
|
package_sets = self._prepare_package_sets(
|
||||||
|
load_old_gather_result, requires=[], provides=[]
|
||||||
|
)
|
||||||
|
compose = helpers.DummyCompose(self.topdir, {"gather_allow_reuse": True})
|
||||||
|
lookasides = compose.conf["gather_lookaside_repos"]
|
||||||
|
repos = ["http://localhost/real1.repo", "http://localhost/real2.repo"]
|
||||||
|
lookasides.append(("^Server$", {"x86_64": repos}))
|
||||||
|
load_old_compose_config.return_value = copy.deepcopy(compose.conf)
|
||||||
|
|
||||||
|
gather._update_config(compose, "Server", "x86_64", compose.topdir)
|
||||||
|
result = gather.reuse_old_gather_packages(
|
||||||
|
compose, "x86_64", compose.variants["Server"], package_sets
|
||||||
|
)
|
||||||
|
self.assertEqual(result, None)
|
||||||
|
|
||||||
@mock.patch("pungi.phases.gather.load_old_gather_result")
|
@mock.patch("pungi.phases.gather.load_old_gather_result")
|
||||||
@mock.patch("pungi.phases.gather.load_old_compose_config")
|
@mock.patch("pungi.phases.gather.load_old_compose_config")
|
||||||
def test_reuse_no_old_file_cache(
|
def test_reuse_no_old_file_cache(
|
||||||
|
Loading…
Reference in New Issue
Block a user