fixed commit

This commit is contained in:
Olof hagsand 2016-02-22 23:07:30 +01:00
parent d6e393ea58
commit 33fac8a4c6
4 changed files with 23 additions and 959 deletions

View file

@ -615,19 +615,20 @@ xml_default(cxobj *x,
continue;
assert(y->ys_cv);
if (!cv_flag(y->ys_cv, V_UNSET)){ /* Default value exists */
if (!xml_find(x, y->ys_argument))
if (!xml_find(x, y->ys_argument)){
if ((xc = xml_new_spec(y->ys_argument, x, y)) == NULL)
goto done;
if ((xb = xml_new("body", xc)) == NULL)
goto done;
xml_type_set(xb, CX_BODY);
if ((str = cv2str_dup(y->ys_cv)) == NULL){
clicon_err(OE_UNIX, errno, "cv2str_dup");
goto done;
if ((xb = xml_new("body", xc)) == NULL)
goto done;
xml_type_set(xb, CX_BODY);
if ((str = cv2str_dup(y->ys_cv)) == NULL){
clicon_err(OE_UNIX, errno, "cv2str_dup");
goto done;
}
if (xml_value_set(xb, str) < 0)
goto done;
free(str);
}
if (xml_value_set(xb, str) < 0)
goto done;
free(str);
}
}
}

View file

@ -395,6 +395,8 @@ ys_cv_validate(cg_var *cv, yang_stmt *ys, char **reason)
uint8_t fraction;
yang_stmt *yi = NULL;
if (reason)
*reason = NULL;
if (ys->ys_keyword != Y_LEAF && ys->ys_keyword != Y_LEAF_LIST)
return 0;
ycv = ys->ys_cv;