Allow reading configuration from JSON
JIRA: COMPOSE-3064 Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
f809cac0b2
commit
605c9ca435
@ -218,6 +218,12 @@ def main():
|
||||
kobo.log.add_stderr_logger(logger)
|
||||
|
||||
conf = kobo.conf.PyConfigParser()
|
||||
if opts.config.endswith(".json"):
|
||||
with open(opts.config) as f:
|
||||
conf.load_from_dict(json.load(f))
|
||||
conf.opened_files = [opts.config]
|
||||
conf._open_file = opts.config
|
||||
else:
|
||||
conf.load_from_file(opts.config)
|
||||
|
||||
compose_type = opts.compose_type or conf.get('compose_type', 'production')
|
||||
|
Loading…
Reference in New Issue
Block a user