I am working on a parse for verifying configs for wlan controllers and I thought I had something. I usually use show commands but all I have available are the configs in a text format.
I have some configs that have either or of these lines. They are pulled and saved with putty.
VLAN........................
..................... 900
VLAN............................................. 900
Code I am using is rather simple
from ciscoconfparse import CiscoConfParse
parse = CiscoConfParse('config.txt', syntax='ios')
vlan = parse.find_objects(r'^VLAN')
#print(vlan)
vlan_id = vlan[0]
print(" VLAN: {0}".format(vlan_id.text))
if in the config it is one line I can trim it up and get the vlan id, but if it is in two lines I do not get the vlan id.
With this in the config I do not get a vlan id
VLAN........................
..................... 900
This I do
VLAN............................................. 900
I am looking for a way just to get the vlan id on either way it is formatted in the conig.
Thank you