Modified YANG deviate+derived solution

Changed flag to YANG_FLAG_REFINE
More complete test
This commit is contained in:
Olof hagsand 2024-08-16 09:19:15 +02:00
parent 442e0391cc
commit 39fb149756
5 changed files with 108 additions and 85 deletions

View file

@ -2416,6 +2416,8 @@ yang_deviation(yang_stmt *ys,
/* Make a copy of deviate child and insert. */
if ((yc1 = ys_dup(yc)) == NULL)
goto done;
if (yang_apply(yc1, -1, (yang_applyfn_t*)yang_flag_set, -1, (void*)YANG_FLAG_REFINE) < 0)
goto done;
if (yn_insert(ytarget, yc1) < 0)
goto done;
}
@ -2449,7 +2451,8 @@ yang_deviation(yang_stmt *ys,
/* Make a copy of deviate child and insert. */
if ((yc1 = ys_dup(yc)) == NULL)
goto done;
yang_flag_set(yc1, YANG_FLAG_NOORIG);
if (yang_apply(yc1, -1, (yang_applyfn_t*)yang_flag_set, -1, (void*)YANG_FLAG_REFINE) < 0)
goto done;
if (yn_insert(ytarget, yc1) < 0)
goto done;
}

View file

@ -1486,7 +1486,7 @@ yang_type_get(yang_stmt *ys,
clixon_err(OE_DB, ENOENT, "mandatory type object is not found");
goto done;
}
if ((yorig = yang_orig_get(ys)) != NULL && yang_flag_get(ytype, YANG_FLAG_NOORIG) == 0){
if ((yorig = yang_orig_get(ys)) != NULL && yang_flag_get(ytype, YANG_FLAG_REFINE) == 0){
ys = yorig;
if ((ytype = yang_find(ys, Y_TYPE, NULL)) == NULL){
clixon_err(OE_DB, ENOENT, "mandatory type object is not found");