diff --git a/gestion/gen_confs/dhcpd_new.py b/gestion/gen_confs/dhcpd_new.py index 8c1452d8..3e0d7d84 100755 --- a/gestion/gen_confs/dhcpd_new.py +++ b/gestion/gen_confs/dhcpd_new.py @@ -10,6 +10,7 @@ Licence : GPLv2 from iptools import AddrInNet from gen_confs import gen_config from ldap_crans import hostname +from config import NETs class dhcp(gen_config) : """ Génération du fichier de déclaration des hosts. @@ -28,6 +29,9 @@ class dhcp(gen_config) : elif hostname == 'titanic': restart_cmd = '/etc/init.d/dhcp3-server restart' 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': restart_cmd = '/etc/init.d/dhcp3-server restart' reseaux = { '138.231.144.0/21' : '/etc/dhcp3/generated/wifi.liste' } diff --git a/gestion/gen_confs/generate.py b/gestion/gen_confs/generate.py index f20064f5..2cff5260 100644 --- a/gestion/gen_confs/generate.py +++ b/gestion/gen_confs/generate.py @@ -220,6 +220,11 @@ class komaz(base_reconfigure): def classify(self, 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): def dhcp(self): from gen_confs.dhcpd_new import dhcp diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index 44172e91..19ad8fda 100644 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -2828,6 +2828,9 @@ Contactez nounou si la MAC est bien celle d'une carte.""", 3) pool_ip = lister_ip_dispo('all') else: 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': net = config.NETs['personnel-ens']