On gère le fait qu'une machine puisse ne pas avoir de rid.
This commit is contained in:
parent
607a691a88
commit
83a618de07
1 changed files with 13 additions and 4 deletions
|
@ -121,10 +121,19 @@ def machine(machine, params):
|
||||||
|
|
||||||
|
|
||||||
def list_machines(machines, width=None):
|
def list_machines(machines, width=None):
|
||||||
return tableau([
|
data = [
|
||||||
[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['mid'][0],
|
||||||
m.blacklist_actif()[0] if m.blacklist_actif() else '-'] for m in machines],
|
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'],
|
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],
|
largeur = [5, 5, 6, '*', 15, 17, 10],
|
||||||
alignement = ['d', 'd', 'c', 'c', 'c', 'c', 'c'],
|
alignement = ['d', 'd', 'c', 'c', 'c', 'c', 'c'],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue