[gestion/{gest_crans,no_dispo,ldap_crans}] Ajout des personnels de l'ens
Pour l'instant c'est fait de manire crade: * Les personnels de l'ENS sont des adhrents normaux * Leurs tudes sont "Personnel ENS" * Il peuvent avoir autant de machines qu'ils veulent qui seront dans 10.9.2.0/24 darcs-hash:20090225211035-bd074-14893e8493de4731e0c7cdbaebb1f82b749a330b.gz
This commit is contained in:
parent
e0a0c0285c
commit
8bb0244c5c
4 changed files with 15 additions and 9 deletions
|
@ -374,6 +374,7 @@ NETs = { 'serveurs' : [ '138.231.136.0/28' ],
|
||||||
'fil' : [ '138.231.136.0/21' ],
|
'fil' : [ '138.231.136.0/21' ],
|
||||||
'wifi': [ '138.231.148.0/21' ],
|
'wifi': [ '138.231.148.0/21' ],
|
||||||
'gratuit': [ '10.42.0.0/16' ],
|
'gratuit': [ '10.42.0.0/16' ],
|
||||||
|
'personnel-ens': ['10.2.9.0/24' ],
|
||||||
'all' : [ '138.231.136.0/21', '138.231.148.0/21' ]
|
'all' : [ '138.231.136.0/21', '138.231.148.0/21' ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -196,6 +196,7 @@ def set_etudes(adher):
|
||||||
arg += u'"P12" "Université Val de Marne" '
|
arg += u'"P12" "Université Val de Marne" '
|
||||||
arg += u'"P13" "Université Paris Nord" '
|
arg += u'"P13" "Université Paris Nord" '
|
||||||
arg += u'"IUFM" "" '
|
arg += u'"IUFM" "" '
|
||||||
|
arg += u'"Personnel ENS" "dans les appartements de l\'ENS"'
|
||||||
if not adher.etudes(0):
|
if not adher.etudes(0):
|
||||||
arg += u'"Autre" ""'
|
arg += u'"Autre" ""'
|
||||||
|
|
||||||
|
@ -245,6 +246,8 @@ def set_etudes(adher):
|
||||||
arg += u'"Autre" ""'
|
arg += u'"Autre" ""'
|
||||||
annul, result = dialog(arg)
|
annul, result = dialog(arg)
|
||||||
if annul: return 1
|
if annul: return 1
|
||||||
|
elif etudes[0] == "Personnel ENS":
|
||||||
|
result = ['0']
|
||||||
else:
|
else:
|
||||||
result = ['Autre']
|
result = ['Autre']
|
||||||
|
|
||||||
|
@ -318,7 +321,8 @@ def set_etudes(adher):
|
||||||
arg += u'--msgbox "Réponse invalide\n\n\n" 0 0'
|
arg += u'--msgbox "Réponse invalide\n\n\n" 0 0'
|
||||||
dialog(arg)
|
dialog(arg)
|
||||||
return __etudes_annee()
|
return __etudes_annee()
|
||||||
|
elif etudes[0] == 'Personnel ENS':
|
||||||
|
result = ['n/a']
|
||||||
else:
|
else:
|
||||||
result = ['Autre']
|
result = ['Autre']
|
||||||
|
|
||||||
|
@ -349,7 +353,6 @@ def set_etudes(adher):
|
||||||
if step == 3:
|
if step == 3:
|
||||||
if __etudes_section(): step -= 1
|
if __etudes_section(): step -= 1
|
||||||
else: break
|
else: break
|
||||||
|
|
||||||
try:
|
try:
|
||||||
adher.etudes(etudes)
|
adher.etudes(etudes)
|
||||||
except ValueError, c:
|
except ValueError, c:
|
||||||
|
@ -1431,10 +1434,9 @@ def set_machine(machine):
|
||||||
err += c.args[0] + '\n'
|
err += c.args[0] + '\n'
|
||||||
|
|
||||||
except EnvironmentError, c: err += c.args[0] + '\n'
|
except EnvironmentError, c: err += c.args[0] + '\n'
|
||||||
|
|
||||||
try: machine.ip(result[2])
|
try: machine.ip(result[2])
|
||||||
except ValueError, c: err += c.args[0] + '\n'
|
except ValueError, c: err += c.args[0] + '\n'
|
||||||
except EnvironmentError, c: err += c.args[0] + '\n'
|
except EnvironmentError, c: err += c.__str__() + '\n'
|
||||||
except RuntimeError, c: err += c.args[0] + '\n' # Plus d'IP libres, peut-être à traiter differement ?
|
except RuntimeError, c: err += c.args[0] + '\n' # Plus d'IP libres, peut-être à traiter differement ?
|
||||||
|
|
||||||
if isadm:
|
if isadm:
|
||||||
|
@ -2088,7 +2090,7 @@ def menu_principal():
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
choix = "Fixe"
|
choix = "Fixe"
|
||||||
elif isinstance(proprio, Club) or not proprio.machines_fixes() or proprio.droits():
|
elif isinstance(proprio, Club) or not proprio.machines_fixes() or proprio.droits() or proprio.etudes(0) == 'Personnel ENS':
|
||||||
arg = u'--title "Nouvelle machine" '
|
arg = u'--title "Nouvelle machine" '
|
||||||
arg += u'--menu "Type de machine ?" 0 0 0 '
|
arg += u'--menu "Type de machine ?" 0 0 0 '
|
||||||
arg += u'"Fixe" "Machine fixe" '
|
arg += u'"Fixe" "Machine fixe" '
|
||||||
|
|
|
@ -2794,7 +2794,10 @@ class Machine(BaseClasseCrans):
|
||||||
else:
|
else:
|
||||||
proprio = self.proprietaire()
|
proprio = self.proprietaire()
|
||||||
|
|
||||||
if not isinstance(proprio, Adherent) or proprio.adherentPayant():
|
if proprio.etudes(0) == 'Personnel ENS':
|
||||||
|
net = config.NETs['personnel-ens']
|
||||||
|
pool_ip = lister_ip_dispo('personnel-ens')
|
||||||
|
elif not isinstance(proprio, Adherent) or proprio.adherentPayant():
|
||||||
try:
|
try:
|
||||||
net = config.NETs['adherents']
|
net = config.NETs['adherents']
|
||||||
pool_ip = lister_ip_dispo('adherents')
|
pool_ip = lister_ip_dispo('adherents')
|
||||||
|
|
|
@ -63,11 +63,11 @@ def update_ip(plage, occupees):
|
||||||
pool_ip.append(ip)
|
pool_ip.append(ip)
|
||||||
|
|
||||||
resultat = ''.join('%s\n' % ip for ip in pool_ip if ip not in occupees and not AddrInNet(ip, ancien_vlan_adm))
|
resultat = ''.join('%s\n' % ip for ip in pool_ip if ip not in occupees and not AddrInNet(ip, ancien_vlan_adm))
|
||||||
|
|
||||||
f = open(repertoire + 'ip_' + plage,'w')
|
f = open(repertoire + 'ip_' + plage,'w')
|
||||||
f.write(resultat)
|
f.write(resultat)
|
||||||
f.close
|
f.close
|
||||||
|
|
||||||
def update_ip_fixe(occupees):
|
def update_ip_fixe(occupees):
|
||||||
update_ip('fil', 'ip_fil', occupees)
|
update_ip('fil', 'ip_fil', occupees)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue