From 9bd581a0e9488897ec5e914fdfa8f25cc491d534 Mon Sep 17 00:00:00 2001 From: bernat Date: Mon, 29 Nov 2004 09:00:50 +0100 Subject: [PATCH] Debut de support du DHCP pour nectaris darcs-hash:20041129080050-d1718-39483e17cea64f34963edd813dd0140d7ab8aa92.gz --- gestion/gen_confs/dhcpd.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gestion/gen_confs/dhcpd.py b/gestion/gen_confs/dhcpd.py index 64e54891..d0e49501 100755 --- a/gestion/gen_confs/dhcpd.py +++ b/gestion/gen_confs/dhcpd.py @@ -9,6 +9,7 @@ Licence : GPLv2 from iptools import AddrInNet, param from gen_confs import gen_config +from ldap_crans import hostname class dhcp(gen_config) : """ Génération du fichier de configuration pour dhcpd (DHCPD_CONF) @@ -37,7 +38,11 @@ class dhcp(gen_config) : option domain-name "wifi.crans.org"; option option-119 "wifi.crans.org crans.org";""" } - + + # Pour nectaris, on sert juste le wifi + if hostname == 'nectaris': + del reseaux['138.231.136.0/21'] + # Options communes à toutes les réseaux servis base_dhcp=""" subnet %(network)s netmask %(netmask)s { @@ -95,7 +100,7 @@ subnet %(network)s netmask %(netmask)s { try : hosts[net] += self.host_template % d except : hosts[net] = self.host_template % d t = 1 - if not t and self.verbose : + if not hostname == "nectaris" and not t and self.verbose : warnings += u'Machine ignorée (mid=%s) : ip en dehors des réseaux servis (%s)\n' % ( machine.id(), machine.ip() ) ### Ecriture du fichier