From 58afece033bea099f361d3f647a1ebb133c1dbe6 Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Apr 17 2018 13:32:02 +0000 Subject: Only use comps repo if we really have comps Signed-off-by: Lubomír Sedlář --- diff --git a/pungi/phases/gather/methods/method_deps.py b/pungi/phases/gather/methods/method_deps.py index b47f889..7b1709b 100644 --- a/pungi/phases/gather/methods/method_deps.py +++ b/pungi/phases/gather/methods/method_deps.py @@ -95,8 +95,9 @@ def write_pungi_config(compose, arch, variant, packages, groups, filter_packages repos = { "pungi-repo": compose.paths.work.arch_repo(arch=arch), - "comps-repo": compose.paths.work.comps_repo(arch=arch, variant=variant), } + if compose.has_comps: + repos["comps-repo"] = compose.paths.work.comps_repo(arch=arch, variant=variant) if variant.type == "optional": for var in variant.parent.get_variants( arch=arch, types=["self", "variant", "addon", "layered-product"]): diff --git a/pungi/phases/ostree.py b/pungi/phases/ostree.py index 1a93e11..2918fff 100644 --- a/pungi/phases/ostree.py +++ b/pungi/phases/ostree.py @@ -60,10 +60,10 @@ class OSTreeThread(WorkerThread): repo_baseurl = compose.paths.work.arch_repo('$basearch', create_dir=False) comps_repo = compose.paths.work.comps_repo('$basearch', variant=variant, create_dir=False) - repos = get_repo_dicts(shortcuts.force_list(config['repo']) - + shortcuts.force_list(translate_path(compose, repo_baseurl)) - + shortcuts.force_list(translate_path(compose, comps_repo)), - logger=self.pool) + repos = shortcuts.force_list(config['repo']) + [translate_path(compose, repo_baseurl)] + if compose.has_comps: + repos.append(translate_path(compose, comps_repo)) + repos = get_repo_dicts(repos, logger=self.pool) # copy the original config and update before save to a json file new_config = copy.copy(config) diff --git a/tests/helpers.py b/tests/helpers.py index 34d34fd..0a5f8c4 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -121,6 +121,7 @@ class DummyCompose(object): checks.validate(self.conf) self.paths = paths.Paths(self) self._logger = mock.Mock() + self.has_comps = True self.variants = { 'Server': MockVariant(uid='Server', arches=['x86_64', 'amd64'], type='variant'),