minor things for clixon.4.4

This commit is contained in:
Olof hagsand 2020-03-27 11:20:35 +01:00
parent 916c1aabd7
commit aa191152cb
3 changed files with 11 additions and 6 deletions

View file

@ -117,11 +117,12 @@ enum cxobj_type {CX_ERROR=-1,
* XXX: lacks support for incoming restconf rpc, see api_operations_post_input)
*/
enum yang_bind{
YB_MODULE=0, /* Search for matching yang binding among top-level symbols of Yang modules */
YB_NONE=0, /* Dont do Yang binding */
YB_MODULE, /* Search for matching yang binding among top-level symbols of Yang modules */
YB_PARENT, /* Assume yang binding of existing parent and match its children by name */
YB_NONE, /* Dont do Yang binding */
#ifdef NYI
YB_RPC, /* Assume top-level xml is an netconf RPC message (NYI) */
YB_RPC, /* Assume top-level xml is an netconf RPC message */
#endif
};
typedef enum yang_bind yang_bind;

View file

@ -1653,7 +1653,11 @@ assign_namespaces(cxobj *x0, /* source */
}
}
else{
y = xml_spec(x0);
if ((y = xml_spec(x0)) == NULL){
clicon_err(OE_YANG, ENOENT, "XML %s does not have yang spec",
xml_name(x0));
goto done;
}
if ((prefix1 = strdup(yang_find_myprefix(y))) == NULL){
clicon_err(OE_UNIX, errno, "strdup");
goto done;

View file

@ -6,7 +6,7 @@
# - not a key int
# - key in an ordered-by user
# - key in state data
# Use instance-id for tests,since api-path can only handle keys, and xpath is too complex.
# Use instance-id for tests, since api-path can only handle keys, and xpath is too complex.
# Magic line must be first in script (see README.md)
s="$_" ; . ./lib.sh || if [ "$s" = $0 ]; then exit 0; else return 0; fi
@ -82,7 +82,7 @@ for (( ii=0; ii<10; ii++ )); do
done
# Then measure time for index and non-index, assume correct
# For small nr, the tiome to parse is so much larger than searching (and also parsing involves
# For small nr, the time to parse is so much larger than searching (and also parsing involves
# searching) which makes it hard to make a test comparing accessing the index variable "i" and the
# non-index variable "j".
new "index search latency i=$rndi"