config: Allow validating configuration in JSON
JIRA: COMPOSE-3318 Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
357f556d69
commit
a206a73db1
@ -79,6 +79,12 @@ def read_variants(compose, config):
|
||||
|
||||
def run(config, topdir, has_old, offline):
|
||||
conf = kobo.conf.PyConfigParser()
|
||||
if config.endswith(".json"):
|
||||
with open(config) as f:
|
||||
conf.load_from_dict(json.load(f))
|
||||
conf.opened_files = [config]
|
||||
conf._open_file = config
|
||||
else:
|
||||
conf.load_from_file(config)
|
||||
|
||||
errors, warnings = pungi.checks.validate(conf, offline=offline)
|
||||
|
Loading…
Reference in New Issue
Block a user