From 83a618de07572d1abc4ccbc2246b7611d22d37a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Elliott=20B=C3=A9cue?= Date: Sat, 14 Feb 2015 14:23:26 +0100 Subject: [PATCH] =?UTF-8?q?On=20g=C3=A8re=20le=20fait=20qu'une=20machine?= =?UTF-8?q?=20puisse=20ne=20pas=20avoir=20de=20rid.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- printing/templates/templates.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/printing/templates/templates.py b/printing/templates/templates.py index bce7891..9f8e6a7 100644 --- a/printing/templates/templates.py +++ b/printing/templates/templates.py @@ -121,10 +121,19 @@ def machine(machine, params): def list_machines(machines, width=None): - return tableau([ - [m['mid'][0], m['rid'][0] , str(m['objectClass'][0])[7:], str(m['host'][0]).split('.')[0], - m['ipHostNumber'][0] if m.get('ipHostNumber',[]) else '-', m['macAddress'][0], - m.blacklist_actif()[0] if m.blacklist_actif() else '-'] for m in machines], + data = [ + [ + m['mid'][0], + m['rid'][0] if m['rid'] else '-', + str(m['objectClass'][0])[7:], + str(m['host'][0]).split('.')[0], + m['ipHostNumber'][0] if m.get('ipHostNumber',[]) else '-', + m['macAddress'][0], + m.blacklist_actif()[0] if m.blacklist_actif() else '-', + ] + for m in machines + ] + return tableau(data, titre = [u'mid', u'rid', u'Type', u'Nom de machine', u'Adresse IP', u'Adresse MAC', u'Limitation'], largeur = [5, 5, 6, '*', 15, 17, 10], alignement = ['d', 'd', 'c', 'c', 'c', 'c', 'c'],