diff options
| author | Christian Hopps <chopps@labn.net> | 2023-06-09 16:52:56 -0400 |
|---|---|---|
| committer | Christian Hopps <chopps@labn.net> | 2023-06-12 07:22:30 -0400 |
| commit | 70ff6bb80bf43e55171f328c96f0e45c634a4e1f (patch) | |
| tree | f4229d3e733c7ca24dcc23d6c8bbecc339464a20 /lib/northbound_cli.c | |
| parent | 3895ea777b05c05d8b20d7eb8e3b3033c02c991e (diff) | |
lib: mgmtd: simplify implicit commit code
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'lib/northbound_cli.c')
| -rw-r--r-- | lib/northbound_cli.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/northbound_cli.c b/lib/northbound_cli.c index e9c89d2029..9d6ec66689 100644 --- a/lib/northbound_cli.c +++ b/lib/northbound_cli.c @@ -202,7 +202,7 @@ int nb_cli_apply_changes(struct vty *vty, const char *xpath_base_fmt, ...) return CMD_SUCCESS; implicit_commit = vty_needs_implicit_commit(vty); - ret = vty_mgmt_send_config_data(vty); + ret = vty_mgmt_send_config_data(vty, implicit_commit); if (ret >= 0 && !implicit_commit) vty->mgmt_num_pending_setcfg++; return ret; @@ -229,9 +229,16 @@ int nb_cli_apply_changes_clear_pending(struct vty *vty, if (vty_mgmt_should_process_cli_apply_changes(vty)) { VTY_CHECK_XPATH; - + /* + * The legacy user wanted to clear pending (i.e., perform a + * commit immediately) due to some non-yang compatible + * functionality. This new mgmtd code however, continues to send + * changes putting off the commit until XFRR_end is received + * (i.e., end-of-config-file). This should be fine b/c all + * conversions to mgmtd require full proper implementations. + */ implicit_commit = vty_needs_implicit_commit(vty); - ret = vty_mgmt_send_config_data(vty); + ret = vty_mgmt_send_config_data(vty, implicit_commit); if (ret >= 0 && !implicit_commit) vty->mgmt_num_pending_setcfg++; return ret; |
