* Date-and-time type now properly uses ISO 8601 UTC timezone designators.

* Renamed yang file `ietf-netconf-notification@2008-07-01.yang` to `clixon-rfc5277`.
* Cligen uses posix regex while yang uses XSD. It differs in some aspects. A translator function has been added for `\d` -> `[0-9]` translation, there may be more.
* [ietf-netconf-notification@2008-07-01.yang validation problem #62](https://github.com/clicon/clixon/issues/62)
This commit is contained in:
Olof hagsand 2019-01-11 17:30:08 +01:00
parent 207858e20d
commit f48c8f45c6
16 changed files with 105 additions and 63 deletions

View file

@ -278,8 +278,14 @@ yang2cli_var_sub(clicon_handle h,
}
}
}
if (options & YANG_OPTIONS_PATTERN)
cprintf(cb, " regexp:\"%s\"", pattern);
if (options & YANG_OPTIONS_PATTERN){
char *posix = NULL;
if (regexp_xsd2posix(pattern, &posix) < 0)
goto done;
cprintf(cb, " regexp:\"%s\"", posix);
if (posix)
free(posix);
}
cprintf(cb, ">");
if (helptext)
cprintf(cb, "(\"%s\")", helptext);
@ -329,7 +335,7 @@ yang2cli_var_union_one(clicon_handle h,
goto done;
}
else {
if (clicon_type2cv(origtype, restype, &cvtype) < 0)
if (clicon_type2cv(origtype, restype, ys, &cvtype) < 0)
goto done;
if ((retval = yang2cli_var_sub(h, ys, ytype, cb, helptext, cvtype,
options, cvv, pattern, fraction_digits)) < 0)
@ -417,7 +423,7 @@ yang2cli_var(clicon_handle h,
retval = 0;
goto done;
}
if (clicon_type2cv(origtype, restype, &cvtype) < 0)
if (clicon_type2cv(origtype, restype, ys, &cvtype) < 0)
goto done;
/* Note restype can be NULL here for example with unresolved hardcoded uuid */
if (restype && strcmp(restype, "union") == 0){