From c10f8e6da6ec7bc032c9d8da5efcf598b60c9b2c Mon Sep 17 00:00:00 2001 From: Christian Hopps Date: Sun, 18 Jun 2023 16:19:54 -0400 Subject: mgmtd: KISS the locking code Move away from things like "lock if not locked" type code, require the user has locked prior to geting to that point. For now we warn if we are taking a lock we already had; however, this should really be a failure point. New requirements: SETCFG - not implicit commit - requires user has locked candidate DS and they must unlock after implicit commit - requires user has locked candidate and running DS both locks will be unlocked on reply to the SETCFG COMMITCFG - requires user has locked candidate and running DS and they must unlock after rollback - this code now get both locks and then does an unlock and early return thing on the adapter side. It needs to be un-special cased in follow up work that would also include tests for this functionality. Signed-off-by: Christian Hopps --- lib/northbound_cli.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/northbound_cli.c') diff --git a/lib/northbound_cli.c b/lib/northbound_cli.c index 9d6ec66689..8003679ed5 100644 --- a/lib/northbound_cli.c +++ b/lib/northbound_cli.c @@ -763,7 +763,7 @@ DEFUN (config_exclusive, "Configuration from vty interface\n" "Configure exclusively from this terminal\n") { - return vty_config_enter(vty, true, true); + return vty_config_enter(vty, true, true, false); } /* Configure using a private candidate configuration. */ @@ -773,7 +773,7 @@ DEFUN (config_private, "Configuration from vty interface\n" "Configure using a private candidate configuration\n") { - return vty_config_enter(vty, true, false); + return vty_config_enter(vty, true, false, false); } DEFPY (config_commit, -- cgit v1.2.3