Petite mise jour tools

Pseudo-rparation des scripts dans /usr/scripts/gestion/tools/

darcs-hash:20071211003807-ddb99-4670b17b63d914f1c06f84612aecdb3b9bb909f0.gz
This commit is contained in:
Michel Blockelet 2007-12-11 01:38:07 +01:00
parent 3e269dbbfc
commit a1a9308602
5 changed files with 9 additions and 9 deletions

View file

@ -9,14 +9,14 @@ from ldap_crans import crans_ldap, decode
db = crans_ldap() db = crans_ldap()
txts = [] txts = []
for droit in [ u'Nounou', u'Apprenti', u'Modérateur', u'Câbleur', u'Déconnecteur',u'CVSWeb' , u'WebRadio' , u'Imprimeur'] : for droit in [ u'Nounou', u'Apprenti', u'Moderateur', u'Cableur', u'WebRadio' , u'Imprimeur', u'Bureau', u'Tresorier'] :
adhs = db.search('droits=%s' % droit)['adherent'] adhs = db.search('droits=%s' % droit)['adherent']
noms = [] noms = []
txt = '%s\n' % droit txt = '%s\n' % droit
for adh in adhs : for adh in adhs :
noms.append(u'%s' % adh.Nom().encode('iso-8859-1')) noms.append(u'%s' % adh.Nom())
txt += u' %s' % '\n '.join(noms) txt += u' %s' % '\n '.join(noms)

View file

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

View file

@ -22,7 +22,7 @@ for m in machines :
# texte pour la machine # texte pour la machine
txt = u'' txt = u''
txt += u'Propriétaire : %s\n' % m.proprietaire().Nom().encode('iso-8859-1') txt += u'Propriétaire : %s\n' % m.proprietaire().Nom()
txt += u'Machine : %s\n' % m.nom() txt += u'Machine : %s\n' % m.nom()
if m.portTCPin() : if m.portTCPin() :
txt += u'ports TCP in : %s\n' % ' '.join(m.portTCPin()) txt += u'ports TCP in : %s\n' % ' '.join(m.portTCPin())

View file

@ -15,8 +15,8 @@ txts = []
for c in comptes : for c in comptes :
if not c.compte() : if not c.compte() :
continue continue
quota = getoutput('quota %s | grep "/dev/" | awk \'{ print $1" "$3" "$4 }\'' % c.compte() ) quota = getoutput('quota %s | grep "/dev/" | awk \'{ print $1" "$3" "$4 }\'' % c.compte())
if quota != '/dev/sda1 400000 600000\n/dev/sda2 102400 153600' and quota != '/dev/sda2 102400 153600\n/dev/sda1 400000 600000' : if quota != '/dev/sda1 400000 600000\n/dev/sda2 102400 153600' and quota != '/dev/sda2 102400 153600\n/dev/sda1 400000 600000' :
txts.append( '%s (%s)\n%s' % (c.Nom(), c.compte(), quota) ) txts.append(u'%s (%s)\n%s' % (c.Nom(), c.compte(), quota))
print '\n- - - - - - = = = = = = # # # # # # # # = = = = = = - - - - - -\n'.join(txts).encode('iso-8859-1') print '\n- - - - - - = = = = = = # # # # # # # # = = = = = = - - - - - -\n'.join(txts)

View file

@ -17,7 +17,7 @@ for a in adherents :
# texte pour l'adhérent # texte pour l'adhérent
txt = u'' txt = u''
txt += u'Nom : %s\n' % a.Nom().encode('iso-8859-1') txt += u'Nom : %s\n' % a.Nom()
txt += u'Solde : %s\n' % a.solde() txt += u'Solde : %s\n' % a.solde()
txts.append(txt.strip()) txts.append(txt.strip())