RSSI different de 0 pour les clients inconnus

darcs-hash:20050926082311-d1718-57d40c1d26e60087cade21e964c83efcbecb10b1.gz
This commit is contained in:
bernat 2005-09-26 10:23:11 +02:00
parent b5e66c60ce
commit 3055e902ea

View file

@ -477,18 +477,9 @@ def machine_details(machine) :
authentification="" authentification=""
if not res: if not res:
client_nom = '????' client_nom = '????'
coul_rssi = 'rouge'
rssi = 0
else: else:
client_nom = ", ".join(["%s [%s]" % (x.nom().split(".")[0], client_nom = ", ".join(["%s [%s]" % (x.nom().split(".")[0],
x.proprietaire().Nom()) for x in res]) x.proprietaire().Nom()) for x in res])
# On va choisir la bonne couleur pour le RSSI
if rssi > -88:
coul_rssi = 'vert'
elif rssi > -93:
coul_rssi = 'jaune'
else:
coul_rssi = 'rouge'
# On va regarder si le client est authentifié # On va regarder si le client est authentifié
auth_ok = ipsec_ok(x) auth_ok = ipsec_ok(x)
if auth_ok != None: if auth_ok != None:
@ -496,6 +487,13 @@ def machine_details(machine) :
authentification = "; IPSec: %s" % OK authentification = "; IPSec: %s" % OK
else: else:
authentification = "; IPSec: %s" % ERREUR authentification = "; IPSec: %s" % ERREUR
# On va choisir la bonne couleur pour le RSSI
if rssi > -88:
coul_rssi = 'vert'
elif rssi > -93:
coul_rssi = 'jaune'
else:
coul_rssi = 'rouge'
f += u' %s (%s) (RSSI: %s%s)\n' % (client, client_nom, f += u' %s (%s) (RSSI: %s%s)\n' % (client, client_nom,
coul("%d" % rssi, coul_rssi), coul("%d" % rssi, coul_rssi),
authentification) authentification)