restconf PUT delta
This commit is contained in:
parent
cd33380368
commit
f6284ac933
2 changed files with 11 additions and 9 deletions
|
|
@ -589,6 +589,7 @@ api_data_put(clicon_handle h,
|
|||
xml_type_set(xa, CX_ATTR);
|
||||
if (xml_value_set(xa, xml_operation2str(op)) < 0)
|
||||
goto done;
|
||||
/* XXX Special case path=/restconf/data xml_name(x) == data */
|
||||
/* Replace xbot with x */
|
||||
xp = xml_parent(xbot);
|
||||
xml_purge(xbot);
|
||||
|
|
@ -605,7 +606,6 @@ api_data_put(clicon_handle h,
|
|||
notfound(r);
|
||||
goto ok;
|
||||
}
|
||||
|
||||
if (clicon_rpc_validate(h, "candidate") < 0){
|
||||
if (clicon_rpc_discard_changes(h) < 0)
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -595,7 +595,7 @@ xml_find(cxobj *x_up,
|
|||
}
|
||||
|
||||
/*! Append xc as child to xp. Remove xc from previous parent.
|
||||
* @param[in] xp Parent xml node
|
||||
* @param[in] xp Parent xml node. If NULL just remove from old parent.
|
||||
* @param[in] xc Child xml node to insert under xp
|
||||
* @retval 0 OK
|
||||
* @retval -1 Error
|
||||
|
|
@ -618,10 +618,12 @@ xml_addsub(cxobj *xp,
|
|||
xml_child_rm(oldp, i);
|
||||
}
|
||||
/* Add xc to new parent */
|
||||
if (xp){
|
||||
if (xml_child_append(xp, xc) < 0)
|
||||
return -1;
|
||||
/* Set new parent in child */
|
||||
xml_parent_set(xc, xp);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue