From: Faiyaz Ahmed Date: Wed, 17 Jan 2007 19:33:04 +0000 (+0000) Subject: Added check so we dont keep resending the same email X-Git-Tag: Monitor-1.0-0~103 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=dbfe6652a8654ec633c4ffb9e86e9a61a5516dc6;p=monitor.git Added check so we dont keep resending the same email --- diff --git a/policy.py b/policy.py index 8b1e5f3..f6629fb 100644 --- a/policy.py +++ b/policy.py @@ -3,7 +3,7 @@ # # Faiyaz Ahmed # -# $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