[gest_crans] petit bonus d'aide à la saisie d'une mac fixe

Ignore-this: 90bf93bf17aa83f1cd84b81dbc47f54

darcs-hash:20120708002127-28565-1d1c70264948c9cf538982e8a1029eeda8997ad4.gz
This commit is contained in:
Daniel STAN 2012-07-08 02:21:27 +02:00
parent 54edb48c77
commit 95d711e690
2 changed files with 17 additions and 0 deletions

View file

@ -2210,6 +2210,15 @@ def menu_principal():
try: try:
if choix == 'Fixe': if choix == 'Fixe':
becane = MachineFixe(proprio) becane = MachineFixe(proprio)
#Saisie prédictive de la mac
try:
prise = proprio.chbre().lower()[0] + becane.prise()
f = open('/usr/scripts/var/last_macs/' + prise, 'r')
becane.mac(f.read())
f.close()
except:
pass
elif choix == 'Wifi': elif choix == 'Wifi':
becane = MachineWifi(proprio) becane = MachineWifi(proprio)
except ValueError, c: except ValueError, c:

View file

@ -104,4 +104,12 @@ if __name__ == '__main__' :
"Tunnel-Medium-Type = IEEE-802", "Tunnel-Medium-Type = IEEE-802",
"Tunnel-Private-Group-Id = \"%d\"" % vlans[vlan]]) "Tunnel-Private-Group-Id = \"%d\"" % vlans[vlan]])
# On tente de logguer la dernière mac sur une prise donnée
try:
f = open('/usr/scripts/var/last_macs/' + prise,'w')
f.write(mac)
f.close()
except:
pass
sys.exit(r) sys.exit(r)