Partial fix for https://github.com/clicon/clixon/issues/475
Remove sanity check for insert/search which does not hold for NETCONF attributes
This commit is contained in:
parent
9e54f0602f
commit
cb3e74971d
1 changed files with 13 additions and 4 deletions
|
|
@ -1011,12 +1011,21 @@ xml_insert2(cxobj *xp,
|
|||
}
|
||||
xc = xml_child_i(xp, mid);
|
||||
if ((yc = xml_spec(xc)) == NULL){
|
||||
if (xml_type(xc) != CX_ELMNT)
|
||||
clixon_err(OE_XML, 0, "No spec found %s (wrong xml type:%s)",
|
||||
xml_name(xc), xml_type2str(xml_type(xc)));
|
||||
#if 1
|
||||
cmp = 1;
|
||||
#else
|
||||
/* Strict checks for config, but one may want to merge XMLs with attributes as well,
|
||||
such as NETCONF messages */
|
||||
if (xml_type(xc) == CX_ATTR)
|
||||
clixon_err(OE_XML, 0, "Internal sort error: Unexpected attribute: \"%s:%s\"",
|
||||
xml_prefix(xc), xml_name(xc));
|
||||
else if (xml_type(xc) == CX_ELMNT)
|
||||
clixon_err(OE_XML, 0, "Internal sort error, \"%s:%s\": unexpected node type: %s",
|
||||
xml_prefix(xc), xml_name(xc), xml_type2str(xml_type(xc)));
|
||||
else
|
||||
clixon_err(OE_XML, 0, "No spec found %s", xml_name(xc));
|
||||
clixon_err(OE_XML, 0, "Internal sort error, \"%s:%s\": No yang spec found", xml_prefix(xc), xml_name(xc));
|
||||
goto done;
|
||||
#endif
|
||||
}
|
||||
if (yc == yn){ /* Same yang */
|
||||
if (userorder){ /* append: increment linearly until no longer equal */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue