diff --git a/pungi/phases/gather/sources/source_json.py b/pungi/phases/gather/sources/source_json.py index 404078c2..073935d8 100644 --- a/pungi/phases/gather/sources/source_json.py +++ b/pungi/phases/gather/sources/source_json.py @@ -40,9 +40,11 @@ class GatherSourceJson(pungi.phases.gather.source.GatherSourceBase): enabled = True def __call__(self, arch, variant): - json_path = self.compose.conf["gather_source_mapping"] - data = open(json_path, "r").read() - mapping = json.loads(data) + json_path = self.compose.conf.get("gather_source_mapping") + if not json_path: + return set(), set() + with open(json_path, "r") as f: + mapping = json.load(f) packages = set() if variant is None: