Projet

Général

Profil

status_to_img-accept-status.diff

status_to_img gère les objets status - Daniel Dehennin, 16/09/2010 15:52

Télécharger (875 octets)

Voir les différences:

zephir/monitor/agentmanager/util.py
16 16
import os
17 17
from hashlib import md5
18 18

  
19
from zephir.monitor.agentmanager import status
20

  
19 21
from twisted.python import log
20 22

  
21 23
log.FileLogObserver.timeFormat = "%Y/%m/%d %H:%M:%S %Z"
......
90 92
    return calendar.timegm(date.utctimetuple())
91 93

  
92 94
def status_to_img(s):
93
    if s == "":
95
    if str(s) == "" or str(s) == str(status.Unknown()):
94 96
        return '<img src="/static/img/gris.gif" alt="??"/>'
95
    if s == "On":
97
    if str(s) == "On" or str(s) == str(status.OK()):
96 98
        return '<img src="/static/img/vert.gif" alt="On"/>'
97 99
    return '<img src="/static/img/rouge.gif" alt="Off"/>'
98 100