s_vlan_to_csv

s_vlan_to_csv.script_main(session)
SINGLE device script
Author: Jamie Caesar

This script will output the VLAN database to a CSV file.

One possibly use of this script is to take the .CSV outputs from 2 or more devices, paste them into a single XLS file and use Excel to highlight duplicate values, so VLAN overlaps can be discovered prior to connecting switches together via direct link, OTV, etc. This could also be used to find missing VLANs between 2 large tables that should have the same VLANs.

Parameters:session (sessions.Session) – A subclass of the sessions.Session object that represents this particular script session (either SecureCRTSession or DirectSession)
s_vlan_to_csv.normalize_port_list(vlan_data)

When TextFSM processes a VLAN with a long list of ports, each line will be a separate item in the resulting list. This fuction combines all of those entries into a single string that contains all of the ports in a comma-separated list.

Parameters:vlan_data – The VLAN data from TextFSM that will be modified in-place