summaryrefslogtreecommitdiff
path: root/lib/northbound_cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/northbound_cli.c')
-rw-r--r--lib/northbound_cli.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/lib/northbound_cli.c b/lib/northbound_cli.c
index 8ae44e72d5..01f577fd5b 100644
--- a/lib/northbound_cli.c
+++ b/lib/northbound_cli.c
@@ -492,20 +492,7 @@ DEFUN (config_exclusive,
"Configuration from vty interface\n"
"Configure exclusively from this terminal\n")
{
- if (vty_config_exclusive_lock(vty))
- vty->node = CONFIG_NODE;
- else {
- vty_out(vty, "VTY configuration is locked by other VTY\n");
- return CMD_WARNING_CONFIG_FAILED;
- }
-
- vty->private_config = true;
- vty->candidate_config = nb_config_dup(running_config);
- vty->candidate_config_base = nb_config_dup(running_config);
- vty_out(vty,
- "Warning: uncommitted changes will be discarded on exit.\n\n");
-
- return CMD_SUCCESS;
+ return vty_config_enter(vty, true, true);
}
/* Configure using a private candidate configuration. */
@@ -515,20 +502,7 @@ DEFUN (config_private,
"Configuration from vty interface\n"
"Configure using a private candidate configuration\n")
{
- if (vty_config_lock(vty))
- vty->node = CONFIG_NODE;
- else {
- vty_out(vty, "VTY configuration is locked by other VTY\n");
- return CMD_WARNING_CONFIG_FAILED;
- }
-
- vty->private_config = true;
- vty->candidate_config = nb_config_dup(running_config);
- vty->candidate_config_base = nb_config_dup(running_config);
- vty_out(vty,
- "Warning: uncommitted changes will be discarded on exit.\n\n");
-
- return CMD_SUCCESS;
+ return vty_config_enter(vty, true, false);
}
DEFPY (config_commit,