ajout de la génération du DHCP sur dyson

darcs-hash:20091118210817-61eff-d2426c9a04e1424a15024de5212dc793db6373e3.gz
This commit is contained in:
Stephane Glondu 2009-11-18 22:08:17 +01:00
parent d4fcd4ecc4
commit ef1b93cc42
3 changed files with 12 additions and 0 deletions

View file

@ -10,6 +10,7 @@ Licence : GPLv2
from iptools import AddrInNet from iptools import AddrInNet
from gen_confs import gen_config from gen_confs import gen_config
from ldap_crans import hostname from ldap_crans import hostname
from config import NETs
class dhcp(gen_config) : class dhcp(gen_config) :
""" Génération du fichier de déclaration des hosts. """ Génération du fichier de déclaration des hosts.
@ -28,6 +29,9 @@ class dhcp(gen_config) :
elif hostname == 'titanic': elif hostname == 'titanic':
restart_cmd = '/etc/init.d/dhcp3-server restart' restart_cmd = '/etc/init.d/dhcp3-server restart'
reseaux = { '10.2.9.0/24' : '/etc/dhcp3/generated/appartements.liste' } reseaux = { '10.2.9.0/24' : '/etc/dhcp3/generated/appartements.liste' }
elif hostname == 'dyson':
restart_cmd = '/etc/init.d/dhcp3-server restart'
reseaux = { NETs['adh-g'][0] : '/etc/dhcp3/generate/adh-g.liste' }
elif hostname == 'gordon': elif hostname == 'gordon':
restart_cmd = '/etc/init.d/dhcp3-server restart' restart_cmd = '/etc/init.d/dhcp3-server restart'
reseaux = { '138.231.144.0/21' : '/etc/dhcp3/generated/wifi.liste' } reseaux = { '138.231.144.0/21' : '/etc/dhcp3/generated/wifi.liste' }

View file

@ -220,6 +220,11 @@ class komaz(base_reconfigure):
def classify(self, ips): def classify(self, ips):
self.__fw().classes_p2p_maj(ips) self.__fw().classes_p2p_maj(ips)
class dyson(base_reconfigure):
def dhcp(self):
from gen_confs.dhcp_new import dhcp
self._do(dhcp(), self._machines())
class sable(base_reconfigure): class sable(base_reconfigure):
def dhcp(self): def dhcp(self):
from gen_confs.dhcpd_new import dhcp from gen_confs.dhcpd_new import dhcp

View file

@ -2828,6 +2828,9 @@ Contactez nounou si la MAC est bien celle d'une carte.""", 3)
pool_ip = lister_ip_dispo('all') pool_ip = lister_ip_dispo('all')
else: else:
proprio = self.proprietaire() proprio = self.proprietaire()
if proprio.chbre()[0] in [ 'g', 'G' ]:
net = config.NETs['adh-g']
pool_ip = lister_ip_dispo('adh-g')
if proprio.etudes(0) == 'Personnel ENS': if proprio.etudes(0) == 'Personnel ENS':
net = config.NETs['personnel-ens'] net = config.NETs['personnel-ens']