diff --git a/gestion/annuaires.py b/gestion/annuaires.py index 18d651a5..7db0c418 100755 --- a/gestion/annuaires.py +++ b/gestion/annuaires.py @@ -1,9 +1,7 @@ #!/usr/bin/python # -*- coding: iso-8859-15 -*- -from types import * - -# Liste des switchs +# Liste des bātiments avec switch manageables bat_switchs = [ 'a', 'b', 'c' , 'h' , 'i' , 'g' , 'j' ] aide={ @@ -18,8 +16,6 @@ aide={ #Pour le G : # le signe - indique un cable 10 Mbps # et XXX = prise vide -#Les chambres G121, G241 et G201 ont chacune 2 cables en 100 Mbps qui -#sont branches sur les switchs. # Correspondance chbre -> prise chbre_prises={ 'a' : @@ -452,36 +448,36 @@ chbre_prises={ 'a' : # Prises d'uplink, de machines du crans ou de bornes wifi uplink_prises={ 'i' : -{ 49 : 'uplink->backbone' , 50 : 'uplink->bati1', +{ 49 : 'uplink->backbone' , 50 : 'uplink->bati-1', 149 : 'uplink->bati' } , 'h' : -{ 49 : 'uplink->backbone' , 50 : 'uplink->bath1', +{ 49 : 'uplink->backbone' , 50 : 'uplink->bath-1', 149 : 'uplink->bath' , 150 : 'pegase' } , 'j' : -{ 49 : 'uplink->backbone', 50 : 'uplink->batj1', - 149 : 'uplink->batj', 150 : 'uplink->batj2', - 225 : 'uplink->batj2', 226 : 'uplink->4J' , +{ 49 : 'uplink->backbone', 50 : 'uplink->batj-1', + 149 : 'uplink->batj', 150 : 'uplink->batj-2', + 225 : 'uplink->batj-2', 226 : 'uplink->4J' , 224 : 'wifi_hlim' } , 'g' : -{ 49 : 'uplink->backbone', 50 : 'uplink->batg1' , - 149 : 'uplink->batg' , 150 : 'uplink->batg2' , - 249 : 'uplink->batg1' , 250 : 'uplink->batg4' , - 449 : 'uplink->batg2' , 450 : 'uplink->batg5' , - 549 : 'uplink->batg4' , 550 : 'uplink->batg6' , - 649 : 'uplink->batg5' , 547 : 'wifi_lodur' } , +{ 49 : 'uplink->backbone', 50 : 'uplink->batg-1' , + 149 : 'uplink->batg' , 150 : 'uplink->batg-2' , + 249 : 'uplink->batg-1' , 250 : 'uplink->batg-4' , + 449 : 'uplink->batg-2' , 450 : 'uplink->batg-5' , + 549 : 'uplink->batg-4' , 550 : 'uplink->batg-6' , + 649 : 'uplink->batg-5' , 547 : 'wifi_lodur' } , 'a' : -{ 49 : 'uplink->backbone', 50 : 'uplink->bata1', - 149 : 'uplink->bata', 150 : 'uplink->bata2', - 225 : 'uplink->bata1', 226 : 'libre-service' }, +{ 49 : 'uplink->backbone', 50 : 'uplink->bata-1', + 149 : 'uplink->bata', 150 : 'uplink->bata-2', + 225 : 'uplink->bata-1', 226 : 'libre-service' }, 'b' : -{ 49 : 'uplink->backbone', 50 : 'uplink->batb1', - 149 : 'uplink->batb', 150 : 'uplink->batb2', - 249 : 'uplink->batb1', 250 : 'uplink->batb3', - 349 : 'uplink->batb2', 350 : 'uplink->2B' }, +{ 49 : 'uplink->backbone', 50 : 'uplink->batb-1', + 149 : 'uplink->batb', 150 : 'uplink->batb-2', + 249 : 'uplink->batb-1', 250 : 'uplink->batb-3', + 349 : 'uplink->batb-2', 350 : 'uplink->2B' }, 'c' : -{ 49 : 'uplink->backbone', 50 : 'uplink->batc1', - 149 : 'uplink->batc' , 150 : 'uplink->batc2', - 225 : 'uplink->batc1', 226 : 'locaux_clubs' } +{ 49 : 'uplink->backbone', 50 : 'uplink->batc-1', + 149 : 'uplink->batc' , 150 : 'uplink->batc-2', + 225 : 'uplink->batc-1', 226 : 'locaux_clubs' } } # Dictionnaire inverse @@ -504,7 +500,7 @@ def all_switchs(bat=None): simplement batx""" if bat == None: bat = bat_switchs - if not(type(bat) is TupleType or type(bat) is ListType): + if type(bat) in [ tuple, list ] : bat = [bat] switchs = [] for b in map(lambda x: x.lower(), bat): @@ -516,8 +512,7 @@ def all_switchs(bat=None): else: switchs.append("bat%s-%s" % (b, n)) return switchs - - + # Locaux clubs : lecture dans chbre_prises et ajout des locaux dans les bats non # manageables def locaux_clubs() :