[ldap_crans] on se base sur le nom de machine pour attribuer les IPs du G

darcs-hash:20091119015608-61eff-e8f4b626cca4f11ad5b19acf24e2f954543ae351.gz
This commit is contained in:
Stephane Glondu 2009-11-19 02:56:08 +01:00
parent dd8a054692
commit d3501e0754

View file

@ -2839,8 +2839,7 @@ Contactez nounou si la MAC est bien celle d'une carte.""", 3)
elif not isinstance(proprio, Adherent) or proprio.adherentPayant(): elif not isinstance(proprio, Adherent) or proprio.adherentPayant():
proprio_subnet = 'adherents' proprio_subnet = 'adherents'
try: try:
chbre = proprio.chbre() if self.nom().endswith("-g.crans.org"):
if chbre and chbre[0] == 'G':
proprio_subnet = 'adh-g' proprio_subnet = 'adh-g'
net = config.NETs[proprio_subnet] net = config.NETs[proprio_subnet]
pool_ip = lister_ip_dispo(proprio_subnet) pool_ip = lister_ip_dispo(proprio_subnet)