Thanks for clarifying. There seems to be a bug with “cdb_set_case” when the “choice” statement contains “config false” and is located inside something that is “config true”.
You can use MAAPI instead with the advantage that all CDB operational datastore changes are done in the “CDB oper transaction” are set then you apply them avoiding reads in-between your writes:
$ confd_cmd -dd -c 'mcreate /performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}; mset "/performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}/name" "my-hw-component-name"; mset "/performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}/count" 54321'
mcreate "/performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}" ; mset "/performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}/name" "my-hw-component-name" ; mset "/performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}/count" "54321"
TRACE Connected (maapi) to ConfD
TRACE MAAPI_START_USER_SESSION --> CONFD_OK
TRACE MAAPI_START_TRANS --> CONFD_OK
TRACE MAAPI_CREATE /performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL} --> CONFD_OK
TRACE MAAPI_SET_ELEM2 /performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}/name --> CONFD_OK
TRACE MAAPI_SET_ELEM2 /performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}/count --> CONFD_OK
TRACE MAAPI_APPLY_TRANS --> CONFD_OK
TRACE MAAPI_STOP_TRANS --> CONFD_OK
TRACE MAAPI_END_USER_SESSION --> CONFD_OK
$ confd_load -dd -o -F p -p /performance-measurement-objects
TRACE Connected (maapi) to ConfD
starting user session ctxt=system user=system groups=[system]
TRACE MAAPI_START_USER_SESSION --> CONFD_OK
TRACE MAAPI_START_TRANS --> CONFD_OK
TRACE MAAPI_SAVE_CONFIG --> CONFD_OK
TRACE Connected (stream) to ConfD
<config xmlns="http://tail-f.com/ns/config/1.0">
<performance-measurement-objects xmlns="http://tail-f.com/ns/example/dhcpd">
<rx-window-measurement-objects>
<measurement-object>RX_TOTAL</measurement-object>
<name>my-hw-component-name</name>
<count>54321</count>
</rx-window-measurement-objects>
</performance-measurement-objects>
TRACE MAAPI_SAVE_CONFIG_RESULT --> CONFD_OK
</config>
TRACE MAAPI_END_USER_SESSION --> CONFD_OK
$ confd_cmd -dd -c 'mget_case /performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL} object-unit-id'
mget_case "/performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}" "object-unit-id"
TRACE Connected (maapi) to ConfD
TRACE MAAPI_LOAD_ALL_NS
TRACE MAAPI_LOAD_MNS_MAPS
TRACE MAAPI_LOAD_HASH_DB
TRACE Connected (maapi) to ConfD
TRACE MAAPI_START_USER_SESSION --> CONFD_OK
TRACE MAAPI_START_TRANS --> CONFD_OK
TRACE MAAPI_GET_CASE /performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL} --> CONFD_OK
RU
TRACE MAAPI_APPLY_TRANS --> CONFD_OK
TRACE MAAPI_STOP_TRANS --> CONFD_OK
TRACE MAAPI_END_USER_SESSION --> CONFD_OK