I tried to create a property based on openconfig-platform.yang,
ret = cdb_create(sock, "/components/component{chassiscontroller}/"
"properties/property{%s}", property_name);
where debugged output shows property_name is a C string like “fw-version-cpld”. The call failed with -1 as the return value, and confd_strerror(confd_errno) shows “badly formatted or nonexistent path”. If I use an xml file with
Please see the ERRORS section of the confd_lib_lib(3) manual page. The confd_errno values are in most cases pretty generic, e.g. the CONFD_ERR_BADPATH that you encountered just means “there is something wrong with a path”, and confd_strerror() will only produce a fixed text with corresponding info (similar to libc strerror(3)). In cases where the problem isn’t obvious from the confd_errno value, more specific information will/should be provided by confd_lasterr().
So, please check what confd_lasterr() says in this case. Without looking at the YANG model, I can venture a guess that you are trying to create configuration data, which is not possible via the CDB API, since it must always be done through a transaction (i.e. you need to use the MAAPI API). The “write” functions in the CDB API can only be used to create/modify/delete operational (“config false”) data in CDB.