Experimental: Added CLICON_TRANSACTION_MOD configurqation option. If set,
modifications in validation and commit callbacks are written back into the datastore.
This commit is contained in:
parent
695aef2cb6
commit
11e2b91a05
3 changed files with 21 additions and 1 deletions
|
|
@ -5,6 +5,9 @@
|
|||
|
||||
### Major changes:
|
||||
### Minor changes:
|
||||
* Experimental: Added CLICON_TRANSACTION_MOD configurqation option. If set,
|
||||
modifications in validation and commit callbacks are written back
|
||||
into the datastore.
|
||||
* Invalid key to api_path2xml gives warning instead of error and quit.
|
||||
* Added restconf/operations get, see RFC8040 Sec 3.3.2:
|
||||
* yang_find_topnode() and api_path2xml() schemanode parameter replaced with yang_class. Replace as follows: 0 -> YC_DATANODE, 1 -> YC_SCHEMANODE
|
||||
|
|
|
|||
|
|
@ -239,13 +239,20 @@ candidate_commit(clicon_handle h,
|
|||
if (plugin_transaction_commit(h, td) < 0)
|
||||
goto done;
|
||||
|
||||
/* 8. Success: Copy candidate to running */
|
||||
/* Optionally write (potentially modified) tree back to candidate */
|
||||
if (clicon_option_bool(h, "CLICON_TRANSACTION_MOD"))
|
||||
if (xmldb_put(h, candidate, OP_REPLACE, td->td_target) < 0)
|
||||
goto done;
|
||||
/* 8. Success: Copy candidate to running
|
||||
*/
|
||||
|
||||
if (xmldb_copy(h, candidate, "running") < 0)
|
||||
goto done;
|
||||
|
||||
/* 9. Call plugin transaction end callbacks */
|
||||
plugin_transaction_end(h, td);
|
||||
|
||||
|
||||
/* 8. Copy running back to candidate in case end functions updated running */
|
||||
if (xmldb_copy(h, "running", candidate) < 0){
|
||||
/* ignore errors or signal major setback ? */
|
||||
|
|
@ -392,6 +399,10 @@ from_client_validate(clicon_handle h,
|
|||
clicon_err_reason);
|
||||
goto ok;
|
||||
}
|
||||
/* Optionally write (potentially modified) tree back to candidate */
|
||||
if (clicon_option_bool(h, "CLICON_TRANSACTION_MOD"))
|
||||
if (xmldb_put(h, "candidate", OP_REPLACE, td->td_target) < 0)
|
||||
goto done;
|
||||
cprintf(cbret, "<rpc-reply><ok/></rpc-reply>");
|
||||
ok:
|
||||
retval = 0;
|
||||
|
|
|
|||
|
|
@ -300,5 +300,11 @@ module clixon-config {
|
|||
type startup_mode;
|
||||
description "Which method to boot/start clicon backend";
|
||||
}
|
||||
leaf CLICON_TRANSACTION_MOD {
|
||||
type boolean;
|
||||
default false;
|
||||
description "If set, modifications in validation and commit
|
||||
callbacks will be saved into running";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue