From bf4a9b557fda64da80e081034629cc295f13d2da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Elliott=20B=C3=A9cue?= Date: Wed, 13 Feb 2013 16:42:25 +0100 Subject: [PATCH] =?UTF-8?q?[whos.py]=20Correction=20d'une=20=C3=A2nerie=20?= =?UTF-8?q?casse=20pieds.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit whos.py a une option -b, qui permet de rajouter dans la recherche qu'on se limite aux bornes. Mais comme ça lui suffit pas, il revérifie a posteriori que les objets récupérés sont bien des bornes, alors que le critère de recherche est spécifique des bornes (dans ldap). C'est stupide, et depuis une des modifs, ça faisait de la merde. Donc je vire. --- gestion/whos.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gestion/whos.py b/gestion/whos.py index 84c835af..4fe0796e 100755 --- a/gestion/whos.py +++ b/gestion/whos.py @@ -367,7 +367,6 @@ def list_bornes(bornes) : nok = u'\x1b[1;31md\x1b[1;0m' for b in bornes : t, bl = __bases_machines(b) - if t != 'born' : continue # Données try : @@ -387,13 +386,13 @@ def list_bornes(bornes) : else : puiss = b.puissance() - data.append([b.id(), b.nom().split('.')[0], b.ip(), b.mac(), etat, b.canal(), puiss, b.prise(), l]) + data.append([b.id(), b.rid(), b.nom().split('.')[0], b.ip(), b.mac(), etat, b.canal(), puiss, b.prise(), l]) return u"Can=canaux, P=puissance, E=état\n" + \ tableau(data, - titre = [u'mid', u'Nom', u'Adresse IP', u'Adresse MAC', u'E', u'Can', u'P', u'Pris', u'Lieu'], - largeur = [5, 13, 15, 17, 1, 5, 3, 4, '*'], - alignement = ['d', 'c', 'c', 'c', 'c', 'c', 'c', 'g', 'c']) + titre = [u'mid', u'rid', u'Nom', u'Adresse IP', u'Adresse MAC', u'E', u'Can', u'P', u'Pris', u'Lieu'], + largeur = [5, 5, 23, 15, 17, 1, 5, 3, 4, '*'], + alignement = ['d', 'd', 'c', 'c', 'c', 'c', 'c', 'c', 'g', 'c']) def adher_details(adher) : """