summaryrefslogtreecommitdiff
path: root/lib/vty.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-12-09 09:35:49 -0500
committerGitHub <noreply@github.com>2018-12-09 09:35:49 -0500
commit64b81b3a6471cd2f44a9524f0c346efe8e263c0f (patch)
treed790041e0628f8d15f3b496feded41ea3caff3d5 /lib/vty.c
parentf7b0f4ef9e6efaafb77bf60ec897e931d340843b (diff)
parentfbdc1c0a8484301111582dcbef90b8ec646db6dd (diff)
Merge pull request #3442 from opensourcerouting/confirmed-commits
lib: add support for confirmed commits
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 9908ada7f0..085cbac742 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2714,6 +2714,14 @@ int vty_config_enter(struct vty *vty, bool private_config, bool exclusive)
void vty_config_exit(struct vty *vty)
{
+ /* Check if there's a pending confirmed commit. */
+ if (vty->t_confirmed_commit_timeout) {
+ vty_out(vty,
+ "WARNING: exiting with a pending confirmed commit. Rolling back to previous configuration.\n\n");
+ nb_cli_confirmed_commit_rollback(vty);
+ nb_cli_confirmed_commit_clean(vty);
+ }
+
vty_config_exclusive_unlock(vty);
if (vty->candidate_config) {