Revert Temporar fix in clixon_custom.h: XPATH_CANONICAL_SKIP_CHECK

This commit is contained in:
Olof hagsand 2023-04-19 10:45:21 +02:00
parent c56d5aa44e
commit 04d5f52d90
3 changed files with 15 additions and 21 deletions

View file

@ -201,9 +201,3 @@
* Introduced in 6.1, remove in 6.2
*/
#define AUTOCLI_DEPRECATED_HIDE
/*! Temporar fix for xpath_traverse_canonical for yang schema mount
* Must rewrite function to handle mountpoints, now just ignore errors
* See also
*/
#define XPATH_CANONICAL_SKIP_CHECK

View file

@ -1005,7 +1005,6 @@ xpath_traverse_canonical(xpath_tree *xs,
goto fail;
}
if ((ymod = yang_find_module_by_namespace(yspec, namespace)) == NULL){
#ifndef XPATH_CANONICAL_SKIP_CHECK
if ((cb = cbuf_new()) == NULL){
clicon_err(OE_UNIX, errno, "cbuf_new");
goto done;
@ -1014,11 +1013,13 @@ xpath_traverse_canonical(xpath_tree *xs,
if (reason)
*reason = cb;
goto fail;
#endif
}
#if 0 /* safe-catch if previous check is not considered as an error */
if (ymod == NULL)
prefix1 = prefix0;
else if ((prefix1 = yang_find_myprefix(ymod)) == NULL){
else
#endif
if ((prefix1 = yang_find_myprefix(ymod)) == NULL){
if ((cb = cbuf_new()) == NULL){
clicon_err(OE_UNIX, errno, "cbuf_new");
goto done;

View file

@ -59,9 +59,8 @@ expectpart "$($clixon_util_xpath -c -y $ydir -p "//x[.='42']" -n null:urn:exampl
new "xpath canonical form (no default should fail)"
expectpart "$($clixon_util_xpath -c -y $ydir -p /x/j:y -n i:urn:example:a -n j:urn:example:b 2>&1)" 0 "/x/j:y: No namespace found for prefix"
# comment as long as XPATH_CANONICAL_SKIP_CHECK
#new "xpath canonical form (wrong namespace should fail)"
#expectpart "$($clixon_util_xpath -c -y $ydir -p /i:x/j:y -n i:urn:example:c -n j:urn:example:b 2>&1)" 0 "/i:x/j:y: No yang found for namespace"
new "xpath canonical form (wrong namespace should fail)"
expectpart "$($clixon_util_xpath -c -y $ydir -p /i:x/j:y -n i:urn:example:c -n j:urn:example:b 2>&1)" 0 "/i:x/j:y: No yang found for namespace"
rm -rf $dir