* Made a separate Clixon datastore XML/JSON top-level symbol

* Replaces the hardcoded "config" keyword.
  * Implemented by a compile-time option called `DATASTORE_TOP_SYMBOL` option in clixon_custom.h
* Tests: added endtest to all tests. Removed all premature exits if BE=0
This commit is contained in:
Olof hagsand 2021-03-05 14:15:15 +01:00
parent 2ab90d847b
commit b7991d9b39
132 changed files with 939 additions and 628 deletions

View file

@ -1232,7 +1232,8 @@ _json_parse(char *str,
*/
if (yspec && xml_prefix(x) == NULL
#ifdef XMLDB_CONFIG_HACK
&& strcmp(xml_name(x), "config") != 0
// && !xml_flag(x, XML_FLAG_TOP)
&& strcmp(xml_name(x), DATASTORE_TOP_SYMBOL) != 0
#endif
){
if ((cberr = cbuf_new()) == NULL){
@ -1261,8 +1262,11 @@ _json_parse(char *str,
break;
case YB_MODULE:
#ifdef XMLDB_CONFIG_HACK
if (strcmp(xml_name(x),"config") == 0 ||
strcmp(xml_name(x),"data") == 0){
if (
// xml_flag(x, XML_FLAG_TOP)
strcmp(xml_name(x), DATASTORE_TOP_SYMBOL) == 0
|| strcmp(xml_name(x), NETCONF_OUTPUT_DATA) == 0
){
/* xt:<top> nospec
* x: <config>
* <a> <-- populate from modules