-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mgmtd: add support for native 'edit' operation #15468
Conversation
fc45f09
to
5ce038c
Compare
5ce038c
to
fb36e75
Compare
387d0d0
to
9048226
Compare
This operation basically implements support for RESTCONF operations. It receives an xpath and a data tree in JSON/XML format, instead of a list of (xpath, value) tuples as required by the current protobuf interface. Signed-off-by: Igor Ryzhov <[email protected]>
Signed-off-by: Igor Ryzhov <[email protected]>
9048226
to
1046bef
Compare
lyd_insert_sibling(candidate->dnode, | ||
existing, | ||
&candidate->dnode); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is somewhat tricky to understand at first; maybe adding a comment will improve the clarity? Also a small format change...
if (root)
candidate->dnode = existing;
else if (ex_parent)
lyd_insert_child(ex_parent, existing);
else
/*
* replaced a root level node, this makes sure
* candidate->dnode linkage is updated
*/
lyd_insert_sibling(candidate->dnode, existing,
&candidate->dnode);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider making this change after rebasing #15594
This operation basically implements support for RESTCONF operations. It receives an xpath and a data tree in JSON/XML format, instead of a list of (xpath, value) tuples as required by the current protobuf interface.