gather: Load JSON mapping relative to config dir
JIRA: RHELCMP-7195 Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
33d7290d78
commit
b652119d54
@ -911,7 +911,8 @@ Options
|
||||
**gather_source_mapping**
|
||||
(*str*) -- JSON mapping with initial packages for the compose. The value
|
||||
should be a path to JSON file with following mapping: ``{variant: {arch:
|
||||
{rpm_name: [rpm_arch|None]}}}``.
|
||||
{rpm_name: [rpm_arch|None]}}}``. Relative paths are interpreted relative to
|
||||
the location of main config file.
|
||||
|
||||
**gather_profiler** = False
|
||||
(*bool*) -- When set to ``True`` the gather tool will produce additional
|
||||
|
@ -32,6 +32,7 @@ set([(rpm_name, rpm_arch or None)])
|
||||
|
||||
|
||||
import json
|
||||
import os
|
||||
|
||||
import pungi.phases.gather.source
|
||||
|
||||
@ -41,7 +42,7 @@ class GatherSourceJson(pungi.phases.gather.source.GatherSourceBase):
|
||||
json_path = self.compose.conf.get("gather_source_mapping")
|
||||
if not json_path:
|
||||
return set(), set()
|
||||
with open(json_path, "r") as f:
|
||||
with open(os.path.join(self.compose.config_dir, json_path), "r") as f:
|
||||
mapping = json.load(f)
|
||||
|
||||
packages = set()
|
||||
|
Loading…
Reference in New Issue
Block a user