Unanswered
Question About The Configuration Format - I'D Like To Parse It Within My Python Code So I'Ll Be Able To Access Things Like
SuccessfulKoala55 this actually doesn't work
` apiserver_conf = ConfigFactory.parse_file(API_SERVER_CONF_PATH)
POINT 1
conf_content = HOCONConverter.to_hocon(config=ConfigFactory.from_dict(apiserver_conf.as_plain_ordered_dict()),
compact=False,
level=0, indent=2)
apiserver_conf['auth']['fixed_users']['users'].append(
ConfigFactory.from_dict({'username': username, 'password': password, 'name': name}))
POINT 2
new_conf_content = HOCONConverter.to_hocon(config=ConfigFactory.from_dict(apiserver_conf.as_plain_ordered_dict()),
compact=False,
level=0, indent=2) Strangely enough running this code results in
new_conf_content == conf_content to be
True . Seems like through this
ConfigTree ` object I can't really apply changes on the configuration file
148 Views
0
Answers
4 years ago
one year ago