]> git.sesse.net Git - nms/commitdiff
Switch to a predefined starting VLAN for each distro.
authorSteinar H. Gunderson <sesse@samfundet.no>
Mon, 10 Apr 2006 19:04:00 +0000 (19:04 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Mon, 10 Apr 2006 19:04:00 +0000 (19:04 +0000)
zyxel/switchmap.py

index 6a402cfaa12e97c2c675e1c764638b1093b0bf30..721e0f68e72a1f31e1c4a471b9cd363c30b532fa 100755 (executable)
@@ -2,6 +2,7 @@
 
 from zyxelcommon import *
 distro_num_switches = [ 0, 0, 0, 0, 0, 0, 0, 0 ];
+distro_vlan_start = [ 301, 405, 509, 617, 727, 835, 938, 1041 ];
 
 vlans = {}
 
@@ -20,7 +21,7 @@ for row in range(1,73,2):
                else:
                        ip = retIP((row,sw))
                        distro = int(retSubnet((row,sw))) - 241
-                       vlan = (distro * 100) + (distro_num_switches[distro] / 5) + 301
+                       vlan = (distro_num_switches[distro] / 5) + distro_vlan_start[distro]
                        distro_num_switches[distro] = distro_num_switches[distro] + 1
 
                        text = "%s/%u" % (ip, vlan)