gather: JSON source returns nothing without configuration

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2017-11-15 16:15:58 +01:00
parent 61a3be2307
commit 670a68a5b8
1 changed files with 5 additions and 3 deletions

View File

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