Skip to content

Commit

Permalink
lib: allow only MODIFY and DESTROY operations in CLI
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Ryzhov <[email protected]>
  • Loading branch information
idryzhov committed Oct 6, 2023
1 parent 55b626b commit 3cbca7c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/northbound_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ void nb_cli_enqueue_change(struct vty *vty, const char *xpath,
{
struct nb_cfg_change *change;

/*
* We don't want object existence checks when using CLI, so allow only
* MODIFY and DESTROY operations.
*/
assert(operation == NB_OP_MODIFY || operation == NB_OP_DESTROY);

if (vty->num_cfg_changes == VTY_MAXCFGCHANGES) {
/* Not expected to happen. */
vty_out(vty,
Expand Down

0 comments on commit 3cbca7c

Please sign in to comment.