Fix reading of nested cnfvars from string
authorAdrian Müller <adrian.mueller@intra2net.com>
Wed, 21 Aug 2024 13:35:35 +0000 (15:35 +0200)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Mon, 30 Sep 2024 08:49:02 +0000 (10:49 +0200)
commit10de90684cfc2e59ddd87acbd88fc8ae6a10a802
tree05978922e5abdac9a94044468de91799ab5b0a75
parent4a5abe5302ed8e6e693ddf8729d3ca778200b685
Fix reading of nested cnfvars from string

The function parse_cnf_children previously disregarded the children
received from a recursive parse_cnf_children call if the state was None
after the recursive function call. Hence, the leftover children would
be omitted instead of attached to the corresponding parent cnfvar. This
lead to the following configuration omitting the _IP and _NETMASK
entries:

1 FIREWALL_NETGROUP,99: "QA host IP"
2   (1) FIREWALL_NETGROUP_NETWORK,0: ""
3     (2) FIREWALL_NETGROUP_NETWORK_IP,0: "192.168.1.254"
4     (2) FIREWALL_NETGROUP_NETWORK_NETMASK,0: "255.255.255.255"
src/cnfvar/string.py
test/cnfvar/test_store.py