gestion: suggestion <automatique> si wifi ou chbre
This commit is contained in:
parent
9b17932814
commit
e79e5c0269
2 changed files with 6 additions and 12 deletions
|
@ -2676,18 +2676,11 @@ 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()
|
|
||||||
becane.ip("<automatique>", lock=False)
|
|
||||||
f = open('/usr/scripts/var/last_macs/' + prise, 'r')
|
|
||||||
becane.mac(f.read(), lock=False)
|
|
||||||
f.close()
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
elif choix == 'Wifi':
|
elif choix == 'Wifi':
|
||||||
becane = MachineWifi(proprio)
|
becane = MachineWifi(proprio)
|
||||||
|
# Suggestion: ne pas relever la mac
|
||||||
|
if choix == 'Wifi' or (choix == 'Fixe' and proprio.chbre() not in ['', 'EXT']):
|
||||||
|
becane.mac("<automatique>")
|
||||||
except ValueError, c:
|
except ValueError, c:
|
||||||
arg = u'--title "Nouvelle machine" '
|
arg = u'--title "Nouvelle machine" '
|
||||||
arg += u'--msgbox "%s\n\n\n" 0 0' % to_unicode(c.args[0])
|
arg += u'--msgbox "%s\n\n\n" 0 0' % to_unicode(c.args[0])
|
||||||
|
|
|
@ -3029,8 +3029,9 @@ class Machine(BaseClasseCrans):
|
||||||
mac = format_mac(mac)
|
mac = format_mac(mac)
|
||||||
|
|
||||||
if mac == '<automatique>':
|
if mac == '<automatique>':
|
||||||
multi_ok = True
|
self._set('macAddress', [mac])
|
||||||
lock = False
|
self.ipv6('')
|
||||||
|
return mac
|
||||||
|
|
||||||
# La MAC serait-elle une MAC à la con ?
|
# La MAC serait-elle une MAC à la con ?
|
||||||
if mac == "00:04:4b:80:80:03":
|
if mac == "00:04:4b:80:80:03":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue