Passage à lc_ldap pour la liste des exemptés

This commit is contained in:
Gabriel Detraz 2015-08-17 12:47:28 +02:00
parent f8e7ffb3ed
commit 5f0247ffb3

View file

@ -1,13 +1,11 @@
#! /usr/bin/env python
#!/bin/bash /usr/scripts/python.sh
# -*- coding: utf-8 -*-
import sys
sys.path.append('/usr/scripts/gestion')
from lc_ldap import shortcuts
from ldap_crans import crans_ldap, decode
ldap = shortcuts.lc_ldap_readonly()
db = crans_ldap()
machines = db.search('exempt=*')['machine']
machines = ldap.search(u"exempt=*")
txts = []
@ -15,9 +13,9 @@ for m in machines :
# texte pour la machine
txt = u''
txt += u'Propriétaire : %s\n' % m.proprietaire().Nom()
txt += u'Machine : %s\n' % m.nom()
txt += u'destination : %s\n' % ', '.join(m.exempt())
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())