diff --git a/arista-vlan-sync.py b/arista-vlan-sync.py index 3f7f88d..128caf1 100644 --- a/arista-vlan-sync.py +++ b/arista-vlan-sync.py @@ -15,6 +15,8 @@ from pathlib import Path # python3 only env_path = Path('.') / '.env' load_dotenv(dotenv_path=env_path) +version = "1.00" # set a version to the program + # Define master switch details MASTER_SWITCH = { "ip": "23.169.120.2", @@ -40,6 +42,7 @@ SWITCHES = [ # Saved as tuple as these should only be read and not altered PROTECTED_VLANS = ("1") +# sync vlan function def sync_vlans(master_switch, switch): # Establish SSH connection to master switch @@ -121,6 +124,9 @@ def sync_vlans(master_switch, switch): master_client.close() switch_client.close() -# Loop through each switch and sync VLANs -for switch in SWITCHES: - sync_vlans(MASTER_SWITCH, switch) +# Main loop +if __name__ == "__main__": + + # Loop through switches and run sync + for switch in SWITCHES: + sync_vlans(MASTER_SWITCH, switch) \ No newline at end of file