Quand getopt supportera les arguments optionnels, on pourra filer une

borne  reconfigurer en particulier.

darcs-hash:20051230144100-d1718-7a7bd2251de49586e2b0ca980f2e7f1d8df535cb.gz
This commit is contained in:
bernat 2005-12-30 15:41:00 +01:00
parent f650df94cf
commit d6fbfa6bed

View file

@ -31,8 +31,9 @@ class conf_wifi_ng(gen_config) :
######################################FIN PARTIE DE CONFIGURATION
def __init__(self) :
def __init__(self, bornes=None) :
self.db = crans_ldap()
self._bornes = bornes
def lockname(self):
# On change le nom du lock pour avoir un nom unique pour tout ce qui
@ -50,6 +51,7 @@ class conf_wifi_ng(gen_config) :
bornes = self.db.search('host=*.wifi.crans.org&ipsec!=*')['machine']
print OK
if not self._bornes:
self.gen_isakmpd(clients)
self.gen_macip(clients, bornes)
self.gen_bornes(bornes)
@ -64,6 +66,8 @@ class conf_wifi_ng(gen_config) :
COMMON = "%s/common" % ROOT
DEFAULT = "%s/default" % ROOT
for borne in bornes:
if self._bornes and borne.nom().split(".")[0] not in self._bornes:
continue
self.anim=anim('\treconfiguration de %s' % borne.nom())
# Il s'agit de faire l'union du répertoire common et du
# répertoire propre (s'il existe) ou alors du répertoire default