]> git.puffer.fish Git - matthieu/frr.git/commit
tools: fix frr-reload for nbr deletion
authorChirag Shah <chirag@nvidia.com>
Wed, 30 Aug 2023 17:57:25 +0000 (10:57 -0700)
committerChirag Shah <chirag@nvidia.com>
Sat, 6 Jan 2024 22:58:41 +0000 (14:58 -0800)
commit2db979522e6277e364e883761577fb680a6404b8
treef653fbb084feea6387a5cac59a7141e08c4f5308
parent4d29c17407cdeb7ddb019045928d9341a0ca3625
tools: fix frr-reload for nbr deletion

bgp neighbor config can have multiple lines, if neighbor is
deleted via frr-reload, no neighbor remote-as <> wipes out
the neighbor, subsequent neighbor associated config deletion
would throw generic error.
Frr-reload needs to move neighbor remote-as line to end and allow
all other config lines to be removed.

Ticket:#3588361 #3589216

Testing Done:
config:
neighbor swp3 interface remote-as external
 neighbor swp3 bfd 3 300 300
 neighbor swp3 password leaf11-spine

INFO: Executed "router bgp 65101  no neighbor swp3 interface remote-as external"
INFO: Failed to execute router bgp 65101  no neighbor swp3 bfd 3 300 300
INFO: Failed to execute router bgp 65101  no neighbor swp3 bfd 3 300
INFO: Failed to execute router bgp 65101  no neighbor swp3 bfd 3
INFO: Failed to execute router bgp 65101  no neighbor swp3 bfd
INFO: Failed to execute router bgp 65101  no neighbor swp3
INFO: Failed to execute router bgp 65101  no neighbor
INFO: Failed to execute router bgp 65101  no
  ERROR: "router bgp 65101 --  no" we failed to remove this command
  ERROR: % Specify remote-as or peer-group commands first

INFO: Failed to execute router bgp 65101  no neighbor swp3 password leaf11-spine
INFO: Failed to execute router bgp 65101  no neighbor swp3 password
INFO: Failed to execute router bgp 65101  no neighbor swp3
INFO: Failed to execute router bgp 65101  no neighbor
INFO: Failed to execute router bgp 65101  no
 ERROR: "router bgp 65101 --  no" we failed to remove this command
 ERROR: % Specify remote-as or peer-group commands first

After fix:

move the neighbor remote-as deletion line to end which allows to remove
other neighbor associated lines to be deleted.
router bgp 65101  no neighbor swp3 interface remote-as external

Signed-off-by: Chirag Shah <chirag@nvidia.com>
tools/frr-reload.py