Created
January 23, 2015 07:32
-
-
Save CrackerJackMack/409b6b2f9e0f0caf0ced to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! | |
router ospf | |
area 0 | |
timers throttle spf 5000 10000 20000 | |
distance external 125 | |
distance inter 125 | |
distance intra 125 | |
! | |
router isis | |
net 10.10.10.10.10 | |
fast-flood 5 | |
is-type level-2 | |
lsp-gen-interval 5 | |
log adjacency | |
address-family ipv4 unicast | |
default-metric 10 | |
maximum-paths 8 | |
metric-style wide | |
redistribute connected | |
redistribute static | |
exit-address-family | |
address-family ipv6 unicast | |
default-metric 10 | |
maximum-paths 8 | |
redistribute connected | |
redistribute static | |
exit-address-family | |
! | |
! | |
router vrrp-extended | |
! | |
! | |
! | |
! | |
! | |
interface loopback 1 | |
ip address 192.168.0.1/32 | |
ipv6 address fe80::30/128 | |
ipv6 enable | |
ipv6 router isis | |
port-name the ipv6 address will be missing | |
! | |
interface loopback 2 | |
port-name brocade config example | |
ip address 192.168.1.1/32 | |
ipv6 address fe80::1aaa/128 | |
ipv6 enable | |
! | |
! | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ciscoconfparse import CiscoConfParse | |
broken = CiscoConfParse('broken.cfg', ignore_blank_lines=True) | |
notbroken = CiscoConfParse('broken.cfg', ignore_blank_lines=False) | |
print "broken:" | |
for child in broken.find_objects('^interface loopback 1$')[0].children: | |
print child | |
print "not broken:" | |
for child in notbroken.find_objects('^interface loopback 1$')[0].children: | |
print child |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment