On ajoute une option bornev6, c'est zoli, et on previent la nounou qui ajoute une machine v6 only

This commit is contained in:
Gabriel Detraz 2015-06-04 23:25:39 +02:00
parent 9da0007d40
commit 2838a60501
2 changed files with 36 additions and 7 deletions

View file

@ -1922,10 +1922,24 @@ def set_machine(machine):
err += c.args[0] + '\n'
except EnvironmentError, c:
err += c.args[0] + '\n'
try: machine.ip(result[2])
except ValueError, c:
err += c.args[0] + '\n'
if len(c.args)>1 and c.args[1] == 1 and isadm:
arg = u'--title "Plage d\'ip" '
arg += u'--yesno "La machine va être ajoutée en v6 only, continuer ? \n" 0 0'
no, res = dialog(arg)
if no:
return set_machine(machine)
else:
try: machine.ip(result[2], lock=True, force=True)
except EnvironmentError, c:
err += c.__str__() + '\n'
except RuntimeError, c:
err += c.args[0] + '\n' # Plus d'IP libres, peut-être à traiter differement ?
except ValueError, c:
err += c.args[0] + '\n'
else:
err += c.args[0] + '\n'
except EnvironmentError, c:
err += c.__str__() + '\n'
except RuntimeError, c:
@ -2616,6 +2630,7 @@ def menu_principal():
if isadm:
arg += u'"aKM" "Ajouter une machine à l\'association" "" '
arg += u'"aKB" "Ajouter une borne wifi" "" '
arg += u'"aKB6" "Ajouter une borne wifi v6" "" '
annul, result = dialog(arg)
if annul: break
@ -2732,6 +2747,13 @@ def menu_principal():
if set_machine(becane):
becane.restore()
elif choix == 'aKB6':
# Ajout borne wifi v6
becane = BorneWifi(AssociationCrans(db.conn))
becane.bornev6 = ['True']
if set_machine(becane):
becane.restore()
##############################################
if choix == 'aMc':