Tidbit: Arista/NAPALM Config Replace

Quick one here — if you are dorking about with NAPALM and config replace (I’ve been using Ansible, but probably same story for just pure Python) and you are getting annoying errors on whatever is AFTER your BGP stanza, make sure you “exit” out of your BGP stanza like so:

 

router bgp 1234
   router-id 1.1.1.1
   neighbor 1.1.1.1 remote-as 1234
   neighbor 1.1.1.1 update-source loopback0
!
  address-family ipv4
   neighbor 1.1.1.1 activate
   network 2.2.2.2/32
   exit 
  exit
!
router ospf 1
  router-id 1.1.1.1

Basically I was getting an annoying error saying something about an invalid token and “‘router ospf 1’ failed:”. Adding the “exit” statements out of each of the nested stanzas of BGP fixed this right away. Hopefully this saves somebody some time 🙂

Advertisements