adm taggued + adh untaggued pour serveur mixte
This commit is contained in:
parent
1edd471ecb
commit
4992818761
1 changed files with 10 additions and 3 deletions
|
@ -156,10 +156,17 @@ class Port(object):
|
|||
"""Renvoie V_TAGGED, V_UNTAGGED ou V_NO
|
||||
suivant le ``vlan`` (str) demandé"""
|
||||
if self.servers:
|
||||
hosts = [unicode(h) for serv in self.servers for h in serv['host']]
|
||||
if all(host.endswith('.adm.crans.org') for host in hosts):
|
||||
if vlan == 'adm':
|
||||
return V_UNTAGGED
|
||||
else:
|
||||
return V_NO
|
||||
else:
|
||||
if vlan == 'adherent':
|
||||
return V_UNTAGGED
|
||||
else:
|
||||
return V_TAGGED
|
||||
if self.uplink:
|
||||
# TODO retirer ce hack dégueux: tous les switchs devraient tout
|
||||
# tagguer, même le vlan adhérent
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue