I'm creating a hocon conf file using pyhocon.(https://github.com/chimpler/pyhocon).
I'm trying to build the hocon file by using a standard hocon file, updating the necessary values and upload the updated file.
deployment {
proxy {
// Name has to be replaced with the name of the project
cluster.TEST {
property1 = [a_list]
property2.host = "hostname"
}
}
}
I'm able to update values using pyhocon:
from pyhocon import ConfigFactory
conf = ConfigFactory.parse_string(hocon_file_template)
host = "something-TEST.trial.com"
conf.put('deployment.proxy.cluster.TEST.property2.host', host)
new = HOCONConverter.convert(conf, "hocon")
However, the converted file gets rid of the dot notation and outputs:
deployment {
proxy {
// Name has to be replaced with the name of the project
cluster {
TEST {
property1 = [a_list]
property2.host = "hostname"
}
}
}
}
How do I maintain the attributes in dot notation?