diff --git a/gestion/config.py b/gestion/config.py index 4d0418c7..2cd3186b 100644 --- a/gestion/config.py +++ b/gestion/config.py @@ -374,12 +374,14 @@ NETs = { 'serveurs' : [ '138.231.136.0/28' ], '138.231.138.0/24', '138.231.139.0/24', '138.231.140.0/22' ], + 'adh-g' : [ '138.231.151.0/24' ], 'bornes' : [ '138.231.148.0/24' ], 'vlan-adm' : [ '10.231.136.0/24' ], 'wifi-adh' : [ '138.231.144.0/24', '138.231.145.0/24', '138.231.146.0/24', - '138.231.147.0/24', '138.231.149.0/24', '138.231.150.0/24', '138.231.151.0/24'], + '138.231.147.0/24', '138.231.149.0/24', '138.231.150.0/24' ], 'fil' : [ '138.231.136.0/21' ], - 'wifi': [ '138.231.148.0/21' ], + 'wifi': [ '138.231.148.0/24', '138.231.149.0/24', '138.231.150.0/24', '138.231.151.0/24', + '138.231.152.0/24', '138.231.153.0/24', '138.231.154.0/24' ], 'gratuit': [ '10.42.0.0/16' ], 'personnel-ens': ['10.2.9.0/24' ], 'all' : [ '138.231.136.0/21', '138.231.148.0/21' ] diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index b226bfca..44172e91 100644 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -2833,9 +2833,13 @@ Contactez nounou si la MAC est bien celle d'une carte.""", 3) net = config.NETs['personnel-ens'] pool_ip = lister_ip_dispo('personnel-ens') elif not isinstance(proprio, Adherent) or proprio.adherentPayant(): + proprio_subnet = 'adherents' try: - net = config.NETs['adherents'] - pool_ip = lister_ip_dispo('adherents') + chbre = proprio.chbre() + if chbre and chbre[0] == 'G': + proprio_subnet = 'adh-g' + net = config.NETs[proprio_subnet] + pool_ip = lister_ip_dispo(proprio_subnet) except: raise RuntimeError(u'Impossible de trouver le réseau où placer la machine.') else: