chimpler / pyhocon

HOCON parser for Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nested variable substitution not working

kennethrithvik opened this issue · comments

base.conf

hello="world"
hello1=${hello}

derived.conf

test={include "base.conf"}

this does not resolve the hello1 in base.conf and throws error. This works in HOCON

Cannot resolve variable ${hello}

Same problem here,
base.conf

service = api
service = ${ENV_SERVICE}

derived.conf

include "base.conf"

With files in the same directory.

>>> file_path = os.path.join... # path to file, correctly resolved
>>> hocon_config = pyhocon.ConfigFactory.parse_file(file_path)
>>> hocon_config.history['service']

Screenshot 2021-01-27 at 13 54 00

I have the same problem