22 lines
537 B
Python
Executable file
22 lines
537 B
Python
Executable file
#!/bin/bash /usr/scripts/python.sh
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from lc_ldap import shortcuts
|
|
|
|
ldap = shortcuts.lc_ldap_readonly()
|
|
|
|
machines = ldap.search(u"exempt=*")
|
|
|
|
txts = []
|
|
|
|
for m in machines :
|
|
|
|
# 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']])
|
|
|
|
txts.append(txt.strip())
|
|
|
|
print '\n- - - - - - = = = = = = # # # # # # # # = = = = = = - - - - - -\n'.join(txts)
|