Corrections diverses (merci Fred)
Non fonctionnel pour le moment, on doit garder la description darcs-hash:20040906144539-d1718-5b8c9bc7308184c4d0f8d46b1a0688fe4fbe1619.gz
This commit is contained in:
parent
62ff03aef8
commit
4882f01bb7
1 changed files with 9 additions and 8 deletions
|
@ -145,7 +145,7 @@ class bornes_wifi(gen_config) :
|
|||
# Fichier
|
||||
AUTOEXEC = '/tmp/autoexec.sh'
|
||||
|
||||
autoexec = """#! /bin/sh
|
||||
autoexec = u"""#! /bin/sh
|
||||
#***********************************************************
|
||||
# Ce fichier est généré dans wifi.py
|
||||
# Les données proviennent de la base LDAP et de la conf
|
||||
|
@ -413,24 +413,25 @@ cat /tmp/autoexec.log | busybox logger -t "Statut"
|
|||
|
||||
def _gen(self) :
|
||||
date = time.strftime('%A %d %B %Y %H:%M')
|
||||
BORNES = '## Liste des bornes -- source : base LDAP\n'
|
||||
BORNES = '## MAC - IP - Canal - Puissance - Nom\n'
|
||||
for b in self.db.search('puissance=*')['machine'] :
|
||||
BORNES = u'## Liste des bornes -- source : base LDAP\n'
|
||||
BORNES += u'## MAC - IP - Canal - Puissance - Nom\n'
|
||||
for b in self.db.search('host=*.wifi.crans.org&puissance=*')['machine'] :
|
||||
self.anim.cycle()
|
||||
BORNES += '%s %s %s %s %s\n' % ( b.mac(), b.ip(), b.canal(), b.puissance(), b.nom() )
|
||||
BORNES += u'%s %s %s %s %s\n' % ( b.mac(), b.ip(), b.canal(),
|
||||
b.puissance(), b.nom().split(".")[0] )
|
||||
|
||||
BORNES += '## Fin liste des bornes'
|
||||
BORNES += u'## Fin liste des bornes'
|
||||
|
||||
AUTOEXEC = self.AUTOEXEC
|
||||
fd = self._open_conf(self.AUTOEXEC)
|
||||
fd.write( self.autoexec % vars() )
|
||||
fd.write( (self.autoexec % vars()).encode('iso-8859-15') )
|
||||
fd.close()
|
||||
|
||||
def restart(self) :
|
||||
self.lock()
|
||||
for borne in self.bornes :
|
||||
anim('\treboot de %s' % borne)
|
||||
status, output = commands.getstatusoutput('ssh -i %s -o StrictHostKeyChecking=no root@%s reboot' % ( self.clef, borne ) )
|
||||
status, output = commands.getstatusoutput('echo ssh -i %s -o StrictHostKeyChecking=no root@%s reboot' % ( self.clef, borne ) )
|
||||
if status :
|
||||
print ERREUR
|
||||
if self.debug :
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue