Added check so we dont keep resending the same email
authorFaiyaz Ahmed <faiyaza@cs.princeton.edu>
Wed, 17 Jan 2007 19:33:04 +0000 (19:33 +0000)
committerFaiyaz Ahmed <faiyaza@cs.princeton.edu>
Wed, 17 Jan 2007 19:33:04 +0000 (19:33 +0000)
policy.py

index 8b1e5f3..f6629fb 100644 (file)
--- a/policy.py
+++ b/policy.py
@@ -3,7 +3,7 @@
 #
 # Faiyaz Ahmed <faiyaza@cs.princeton.edu>
 #
-# $Id: policy.py,v 1.6 2007/01/10 20:08:44 faiyaza Exp $
+# $Id: policy.py,v 1.7 2007/01/11 21:39:07 faiyaza Exp $
 #
 # Policy Engine.
 
@@ -108,6 +108,9 @@ class Policy(Thread):
                node = self.sickNoTicket.get(block = True)
                # Get the login base    
                loginbase = plc.siteId(node)
+               
+               # Princeton Backdoor
+               if loginbase == "princeton": return
 
                # Send appropriate message for node if in appropriate bucket.
                # If we know where to send a message
@@ -161,6 +164,7 @@ class Policy(Thread):
                                                plc.removeSliceCreation(node)
                                                mailer.email(sbj, msg, target)  
                                                self.squeezed[loginbase] = (time.time(), "creation")
+                                               self.emailed[node] = ("creation", time.time())  
                                                return
 
                                # If more than PI thresh and slicethresh
@@ -180,6 +184,7 @@ class Policy(Thread):
                                                plc.suspendSlices(node)
                                                self.squeezed[loginbase] = (time.time(), "freeze")
                                                mailer.email(sbj, msg, target)  
+                                               self.emailed[node] = ("freeze", time.time())    
                                                return
 
                        # Find the bucket the node is in and send appropriate email