Chromium Code Reviews| Index: scripts/master/exception_notifier.py |
| diff --git a/scripts/master/exception_notifier.py b/scripts/master/exception_notifier.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cc7e17b4cf0d10a7aa24c509dc0ab0f0662fd3a6 |
| --- /dev/null |
| +++ b/scripts/master/exception_notifier.py |
| @@ -0,0 +1,20 @@ |
| +# Copyright (c) 2012 The Chromium Authors. All rights reserved. |
|
agable
2014/11/17 19:26:42
2014
There are already a bunch of MailNotifier ex
agable
2014/11/17 19:26:42
2014
Honestly, would consider putting this in the
Sergey Berezin
2015/01/06 21:39:48
Done.
|
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +"""A fixed version of MailNotifier which treats exception as failure.""" |
| + |
| +from buildbot.status import mail |
| +from buildbot.status.results import FAILURE, EXCEPTION |
| + |
| +class ExceptionNotifier(mail.MailNotifier): |
| + """Same as MailNotifier, only treats EXCEPTION as failure.""" |
|
agable
2014/11/17 19:26:42
"only" is not the word you want here :)
Sergey Berezin
2015/01/06 21:39:48
Done.
|
| + def isMailNeeded(self, build, results): |
| + builder = build.getBuilder() |
| + if self.builders is not None and builder.name not in self.builders: |
| + return False |
| + if self.categories is not None and builder.category not in self.categories: |
| + return False |
| + if self.mode == 'failing' and results in [FAILURE, EXCEPTION]: |
| + return True |
| + return mail.MailNotifier.isMailNeeded(self, build, results) |