Nettoie list_firewall.py, plus un oublie dans list_exempt
* output est une liste d'unicodes, mieux vaut .join() sur un unicode
This commit is contained in:
parent
a5ddd73ce5
commit
94ee83b86a
2 changed files with 38 additions and 27 deletions
|
@ -12,12 +12,12 @@ def make_output(ldap):
|
|||
machines_avec_exemption = ldap.search(u"exempt=*")
|
||||
output = []
|
||||
|
||||
for m in machines_avec_exemption:
|
||||
for machine in machines_avec_exemption:
|
||||
# texte pour la machine
|
||||
txt = u''
|
||||
txt += u'Propriétaire : %s\n' % m.proprio()
|
||||
txt += u'Machine : %s\n' % m['host'][0]
|
||||
txt += u'destination : %s\n' % ', '.join([unicode(i) for i in m['exempt']])
|
||||
txt = u''
|
||||
txt += u'Propriétaire : %s\n' % machine.proprio()
|
||||
txt += u'Machine : %s\n' % machine['host'][0]
|
||||
txt += u'destination : %s\n' % ', '.join([unicode(i) for i in machine['exempt']])
|
||||
|
||||
output.append(txt.strip())
|
||||
return output
|
||||
|
@ -26,4 +26,4 @@ if __name__ == '__main__':
|
|||
LDAP = shortcuts.lc_ldap_readonly()
|
||||
OUTPUT = make_output(LDAP)
|
||||
|
||||
print '\n- - - - - - = = = = = = # # # # # # # # = = = = = = - - - - - -\n'.join(OUTPUT).encode(out_encoding)
|
||||
print u'\n- - - - - - = = = = = = # # # # # # # # = = = = = = - - - - - -\n'.join(OUTPUT).encode(out_encoding)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue