Legeres modifications
darcs-hash:20070521171719-c992d-37c1a7eaa2aa0c90341ded2bb5bf6d24bcab302e.gz
This commit is contained in:
parent
d951ffc252
commit
5a7d58f5a7
1 changed files with 14 additions and 8 deletions
|
@ -12,7 +12,10 @@ from ldap_crans import crans_ldap
|
|||
from config import NETs
|
||||
from iptools import AddrInNet
|
||||
|
||||
noms_fichiers = {'ip_fil' : '/usr/scripts/var/numeros_disponibles/ip_fixes'}
|
||||
noms_fichiers = {
|
||||
'ip_fil' : '/usr/scripts/var/numeros_disponibles/ip_fixes',
|
||||
'ip_wifi-adh' : '/usr/scripts/var/numeros_disponibles/ip_wifi-adh'
|
||||
}
|
||||
|
||||
db = crans_ldap()
|
||||
|
||||
|
@ -40,12 +43,10 @@ def _update_ip(plage, fichier):
|
|||
|
||||
resultat = ''
|
||||
|
||||
#for ip in pool_ip:
|
||||
# if not db.exist('ipHostNumber=%s' % ip):
|
||||
# resultat += '%s\n' % ip
|
||||
# print '%s\n' % ip
|
||||
|
||||
resultat = '1.2.3.5\n'
|
||||
for ip in pool_ip:
|
||||
if not db.exist('ipHostNumber=%s' % ip):
|
||||
resultat += '%s\n' % ip
|
||||
print '%s\n' % ip
|
||||
|
||||
f = open(noms_fichiers[fichier],'w')
|
||||
f.write(resultat)
|
||||
|
@ -54,4 +55,9 @@ def _update_ip(plage, fichier):
|
|||
def update_ip_fixe():
|
||||
_update_ip('fil', 'ip_fil')
|
||||
|
||||
update_ip_fixe()
|
||||
def update_ip_wifi_adh():
|
||||
_update_ip('wifi-adh','ip_wifi-adh')
|
||||
|
||||
if __name__ == "__main__":
|
||||
update_ip_fixe()
|
||||
update_ip_wifi_adh()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue