try to update bootstates to work appropriately.
authorStephen Soltesz <soltesz@cs.princeton.edu>
Fri, 1 May 2009 19:36:13 +0000 (19:36 +0000)
committerStephen Soltesz <soltesz@cs.princeton.edu>
Fri, 1 May 2009 19:36:13 +0000 (19:36 +0000)
monitor/common.py
nodebad.py

index d082dbb..9878d52 100644 (file)
@@ -58,26 +58,26 @@ def color_pcu_state(fbnode):
                rb = values['reboot']
                if rb == 0 or rb == "0":
                        return fbnode['pcu'] + "OK  "
-                       #return fbnode['pcu'] + "OK  "
-                       #return green(fbnode['pcu'])
                elif "NetDown" == rb  or "Not_Run" == rb:
                        return fbnode['pcu'] + "DOWN"
-                       #return yellow(fbnode['pcu'])
                else:
                        return fbnode['pcu'] + "BAD "
-                       #return red(fbnode['pcu'])
        else:
-               #return red(fbnode['pcu'])
                return fbnode['pcu'] + "BAD "
 
 def color_boot_state(l):
        if    l == "dbg": return yellow("debg")
        elif  l == "dbg ": return yellow("debg")
+       elif  l == "failboot": return yellow("debg")
        elif  l == "diag": return lightblue(l)
+       elif  l == "diagnose": return lightblue(l)
+       elif  l == "safeboot": return lightblue(l)
        elif  l == "disable": return red("dsbl")
+       elif  l == "disabled": return red("dsbl")
        elif  l == "down": return red(l)
        elif  l == "boot": return green(l)
        elif  l == "rins": return blue(l)
+       elif  l == "reinstall": return blue(l)
        else:
                return l
 
index c3aae39..659591d 100755 (executable)
@@ -46,7 +46,7 @@ def check_node_state(rec, node):
                last_contact = None
 
        if boot_state == 'disable': boot_state = 'disabled'
-       if boot_state == 'diag':        boot_state = 'diagnose'
+       if boot_state == 'diag' or boot_state == 'diagnose': boot_state = 'safeboot'
 
        if len(rec.plc_node_stats['pcu_ids']) > 0:
                node.haspcu = True
@@ -68,8 +68,8 @@ def check_node_state(rec, node):
 
        if node_state == 'DEBUG' and node.status != 'monitordebug' and \
                                                                 node.status != 'disabled' and \
-                                                                node.status != 'diagnose':
-               if boot_state != 'disabled' and boot_state != 'diagnose':
+                                                                node.status != 'safeboot':
+               if boot_state != 'disabled' and boot_state != 'safeboot':
 
                        print "changed status from %s to monitordebug" % (node.status)
                        node.status = "monitordebug"
@@ -89,7 +89,7 @@ def check_node_state(rec, node):
        #         online -> good                after half a day
        #         offline -> down               after two days
        #         monitordebug -> down  after 30 days
-       #         diagnose -> monitordebug after 60 days
+       #         safeboot -> monitordebug after 60 days
        #         disabled -> down              after 60 days
 
        if node.status == 'online' and changed_greaterthan(node.last_changed, 0.5):
@@ -107,7 +107,7 @@ def check_node_state(rec, node):
                node.status = 'down'
                # NOTE: do not reset last_changed, or you lose how long it's been down.
 
-       if node.status == 'diagnose' and changed_greaterthan(node.last_changed, 60):
+       if node.status == 'safeboot' and changed_greaterthan(node.last_changed, 60):
                print "changed status from %s to down" % node.status
                # NOTE: change an admin mode back into monitordebug after two months.
                node.status = 'monitordebug'