[wiki-lenny] L'autostatus est en utf-8 maintenant
darcs-hash:20081215231203-bd074-357b818550e3992bc11835eebd5db9cc0005ae6c.gz
This commit is contained in:
parent
32cb1f9b60
commit
1b50b6226f
1 changed files with 5 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import re
|
||||
from commands import getstatusoutput,getoutput
|
||||
|
@ -11,7 +11,7 @@ def execute(macro, text) :
|
|||
f = macro.formatter
|
||||
code = f.table(1)
|
||||
|
||||
typlist = ['routes', 'serveurs', 'serveurs de la ferme', 'switches', 'bornes', u'services extérieurs au crans']
|
||||
typlist = ['routes', 'serveurs', 'serveurs de la ferme', 'switches', 'bornes', u'services extérieurs au crans']
|
||||
|
||||
for typ in typlist:
|
||||
lines = lines [1:]
|
||||
|
@ -22,15 +22,15 @@ def execute(macro, text) :
|
|||
line = lines[0].split(' ')
|
||||
trucsdown += f.table_row(1)
|
||||
trucsdown += f.table_cell(1,{'style':'background-color:lightgrey;'})
|
||||
trucsdown += unicode(f.text('%s (%s)' % (line [0], getoutput("grep '^%s[^-.a-zA-Z]' /usr/scripts/var/autostatus/hosts | cut -d ' ' -f 5-" % line [0])) ), "iso-8859-15")
|
||||
trucsdown += unicode(f.text('%s (%s)' % (line [0], getoutput("grep '^%s[^-.a-zA-Z]' /usr/scripts/var/autostatus/hosts | cut -d ' ' -f 5-" % line [0])) ), "utf-8")
|
||||
trucsdown += f.table_cell(0)
|
||||
# nombre de non réponse au ping
|
||||
# nombre de non réponse au ping
|
||||
if int(line[1]) > 2 :
|
||||
trucsdown += f.table_cell(1,{'style':'background-color:red;'})
|
||||
trucsdown += f.text(u'down')
|
||||
else :
|
||||
trucsdown += f.table_cell(1,{'style':'background-color:blue;'})
|
||||
trucsdown += f.text(u'état incertain')
|
||||
trucsdown += f.text(u'état incertain')
|
||||
trucsdown += f.table_cell(0)
|
||||
trucsdown += f.table_row(0)
|
||||
lines = lines [1:]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue