diff --git a/apps/cli/cli_generate.c b/apps/cli/cli_generate.c
index cebd7731..8d66c0cf 100644
--- a/apps/cli/cli_generate.c
+++ b/apps/cli/cli_generate.c
@@ -163,24 +163,35 @@ cvtype_max2str_dup(enum cv_type type)
* @param[in] ys yang_stmt of the node at hand
* @param[in] cvtype Type of the cligen variable
* @param[in] cb0 The string where the result format string is inserted.
+ * @param[in] options
+ * @param[in] fraction_digits
+
* @see expand_dbvar This is where the expand string is used
+ * @note XXX only fraction_digits handled,should also have mincv, maxcv, pattern
*/
static int
cli_expand_var_generate(clicon_handle h,
yang_stmt *ys,
enum cv_type cvtype,
- cbuf *cb0)
+ cbuf *cb0,
+ int options,
+ uint8_t fraction_digits
+ )
{
int retval = -1;
char *xkfmt = NULL;
if (yang2xmlkeyfmt(ys, &xkfmt) < 0)
goto done;
- cprintf(cb0, "|<%s:%s %s(\"candidate %s\")>",
- ys->ys_argument,
- cv_type2str(cvtype),
+ cprintf(cb0, "|<%s:%s", ys->ys_argument,
+ cv_type2str(cvtype));
+ if (options & YANG_OPTIONS_FRACTION_DIGITS)
+ cprintf(cb0, " fraction-digits:%u", fraction_digits);
+ cprintf(cb0, " %s(\"candidate %s\")>",
GENERATE_EXPAND_XMLDB,
xkfmt);
+
+
retval = 0;
done:
if (xkfmt)
@@ -327,7 +338,8 @@ yang2cli_var_sub(clicon_handle h,
if (helptext)
cprintf(cb0, "(\"%s\")", helptext);
if (completion){
- if (cli_expand_var_generate(h, ys, cvtype, cb0) < 0)
+ if (cli_expand_var_generate(h, ys, cvtype, cb0,
+ options, fraction_digits) < 0)
goto done;
if (helptext)
cprintf(cb0, "(\"%s\")", helptext);
diff --git a/apps/netconf/netconf_rpc.c b/apps/netconf/netconf_rpc.c
index cb5dd206..14b97ec5 100644
--- a/apps/netconf/netconf_rpc.c
+++ b/apps/netconf/netconf_rpc.c
@@ -86,8 +86,8 @@
]]>]]>
* filter subnet + no config:
]]>]]>
- * filter xpath + no select:
- ]]>]]>
+ * filter xpath + select all:
+ ]]>]]>
* filter subnet + config:
]]>]]>
* filter xpath + select:
@@ -152,7 +152,15 @@ netconf_filter_xmldb(clicon_handle h,
clicon_xml2cbuf(cb, xc, 0, 1);
break;
case FILTER_XPATH:
- selector = xml_find_value(xfilter, "select");
+ if ((selector = xml_find_value(xfilter, "select")) == NULL){
+ netconf_create_rpc_error(cb_err, xorig,
+ "missing-attribute",
+ "protocol",
+ "error",
+ NULL,
+ "select");
+ goto done;
+ }
if (xmldb_get(h, source, selector, 0, &xdb, NULL, NULL) < 0){
netconf_create_rpc_error(cb_err, xorig,
"operation-failed",