From 4992818761775420526b3f1130f507f549ff0fd1 Mon Sep 17 00:00:00 2001 From: Daniel STAN Date: Fri, 16 Jan 2015 12:15:16 +0100 Subject: [PATCH] adm taggued + adh untaggued pour serveur mixte --- gestion/gen_confs/switchs2.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gestion/gen_confs/switchs2.py b/gestion/gen_confs/switchs2.py index 41c8d741..b38dff0e 100755 --- a/gestion/gen_confs/switchs2.py +++ b/gestion/gen_confs/switchs2.py @@ -156,10 +156,17 @@ class Port(object): """Renvoie V_TAGGED, V_UNTAGGED ou V_NO suivant le ``vlan`` (str) demandé""" if self.servers: - if vlan == 'adm': - return V_UNTAGGED + 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: - return V_NO + 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