Commit 83a618de authored by Pierre-Elliott Bécue's avatar Pierre-Elliott Bécue

On gère le fait qu'une machine puisse ne pas avoir de rid.

parent 607a691a
......@@ -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'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment