annetutil / annet

configuration generation and deploying utility for network equipment
https://annetutil.github.io/annet/
MIT License
58 stars 21 forks source link

fix cisco af subsection #158

Closed gs1571 closed 6 days ago

gs1571 commented 6 days ago

Some older versions of Cisco IOS doesn't create subsection for address family block.

it looks like:

router bgp 65111
 bgp router-id 1.1.1.1
 bgp log-neighbor-changes
 neighbor SPINE peer-group
 !
 address-family ipv4
 neighbor SPINE send-community both
 neighbor SPINE soft-reconfiguration inbound
 neighbor SPINE route-map TOR_IMPORT_SPINE in
 neighbor SPINE route-map TOR_EXPORT_SPINE out
 exit-address-family

but should be

router bgp 65111
 bgp router-id 1.1.1.1
 bgp log-neighbor-changes
 neighbor SPINE peer-group
 !
 address-family ipv4
  neighbor SPINE send-community both
  neighbor SPINE soft-reconfiguration inbound
  neighbor SPINE route-map TOR_IMPORT_SPINE in
  neighbor SPINE route-map TOR_EXPORT_SPINE out
 exit-address-family

The diff_logic func do it before make diff.