aboutsummaryrefslogtreecommitdiff
path: root/jobmanager.py
diff options
context:
space:
mode:
authorTom Ritter <tom@ritter.vg>2017-02-01 14:19:03 -0600
committerTom Ritter <tom@ritter.vg>2017-02-01 14:19:03 -0600
commit8eae75fa67cd3febea1692f186fa179c9d5b19c4 (patch)
tree1b6d1ca9851fb3a9605146c95eeefad253f74937 /jobmanager.py
parente25776aea113142769bdc95f1f56692eab78ac0e (diff)
Only notify on failures and successes after the number of failures required
Diffstat (limited to 'jobmanager.py')
-rwxr-xr-xjobmanager.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/jobmanager.py b/jobmanager.py
index d77bfb0..e4cb72a 100755
--- a/jobmanager.py
+++ b/jobmanager.py
@@ -65,7 +65,9 @@ class JobManager:
else:
#Successful Run
logging.info("Execution of " + thisJob.getName() + " succeeded")
- if lastRunStatus.CurrentStateSuccess == False and thisJob.notifyOnFailureEvery() == JobBase.JobFailureNotificationFrequency.ONSTATECHANGE:
+ if lastRunStatus.CurrentStateSuccess == False and \
+ thisJob.notifyOnFailureEvery() == JobBase.JobFailureNotificationFrequency.ONSTATECHANGE and \
+ lastRunStatus.NumFailures >= thisJob.numberFailuresBeforeNotification():
if not thisJob.onStateChangeSuccess():
emailWorks = False
lastRunStatus.markSuccessful()