Skip to content

Commit

Permalink
server edit-config BUGFIX leaf-list need a key
Browse files Browse the repository at this point in the history
When targetting leaflist, its value must be specified as key (predicate)
in the XPath expression.

Fixes CESNET#15
  • Loading branch information
rkrejci committed Aug 10, 2016
1 parent e146e6f commit c8b7f44
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/op_editconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ op_editconfig(struct lyd_node *rpc, struct nc_session *ncs)
/* set value for sysrepo */
op_set_srval(iter, NULL, 0, &value, &str);

/* in leaf-list, the value is also the key, so add it into the path */
path_index += sprintf(&path[path_index], "[.=\'%s\']", ((struct lyd_node_leaf_list *)iter)->value_str);

break;
case LYS_LIST:
/* get info about inserting to a specific place */
Expand Down

0 comments on commit c8b7f44

Please sign in to comment.