fix fault if lastContact was None
smbaker [Tue, 18 Dec 2012 02:15:19 +0000 (18:15 -0800)]
apps/gacks/gackshandler_plc.py

index ed9e330..87d1572 100644 (file)
@@ -257,7 +257,11 @@ class GacksPLCHandler(GacksHandler):
                 status = "bad"
 
             # ignore stale nodes
-            lastContact = int(plcNode.get("last_contact"))
+            lastContact = plcNode.get("last_contact",None)
+            if not lastContact:
+                # sometimes lastContact == None
+                lastContact = 0
+            lastContact = int(lastContact)
             if (time.time() - lastContact) > 2*60*60:
                 status = "stale"