highlight "bad" states

This commit is contained in:
andreas
2012-06-09 15:21:07 +00:00
parent e09a23f572
commit 6146e0a4dc
+7 -3
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# $Id: hbd,v 1.29 2012/03/29 00:16:11 andreas Exp $
# $Id: hbd,v 1.30 2012/06/09 15:21:07 andreas Exp $
# Wait for heartbeat messages and act on them (or their absence)
#
import time, os, string, sys, socket, atexit, select, SocketServer, getopt, signal, cPickle
@@ -75,9 +75,13 @@ class Host:
return self.state
def dispstate(self):
if self.state in ["down","overdue"]:
state="<b>%s</b>" % self.state
else:
state="%s" % self.state
if self.doesack != "":
return "%s(%s)" % (self.state, self.doesack)
return self.state
return "%s(%s)" % (state, self.doesack)
return state
# set new state, return number of secs in previous state
def newstate(self, state, when=0):