scripts/gestion/tools/list_exempt.py
chove 477219f2ed imports de petits utilisatires pour faire des stats et voir les tats de
certains trucs

darcs-hash:20050411210725-4ec08-0edcb7b1d4e46ce310dbffcffd8b07e50690c8a1.gz
2005-04-11 23:07:25 +02:00

24 lines
599 B
Python
Executable file

#! /usr/bin/env python
# -*- coding: iso-8859-15 -*-
import sys
sys.path.append('/usr/scripts/gestion')
from ldap_crans import crans_ldap, decode, crans
db = crans_ldap()
machines = db.search('exempt=*')['machine']
txts = []
for m in machines :
# texte pour la machine
txt = u''
txt += u'Propriétaire : %s\n' % m.proprietaire().Nom().encode('iso-8859-1')
txt += u'Machine : %s\n' % m.nom()
txt += u'destination : %s\n' % ', '.join(m.exempt())
txts.append(txt.strip())
print '\n- - - - - - = = = = = = # # # # # # # # = = = = = = - - - - - -\n'.join(txts)