Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # 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.
| |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 """A fixed version of MailNotifier which treats exception as failure.""" | |
| 6 | |
| 7 from buildbot.status import mail | |
| 8 from buildbot.status.results import FAILURE, EXCEPTION | |
| 9 | |
| 10 class ExceptionNotifier(mail.MailNotifier): | |
| 11 """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.
| |
| 12 def isMailNeeded(self, build, results): | |
| 13 builder = build.getBuilder() | |
| 14 if self.builders is not None and builder.name not in self.builders: | |
| 15 return False | |
| 16 if self.categories is not None and builder.category not in self.categories: | |
| 17 return False | |
| 18 if self.mode == 'failing' and results in [FAILURE, EXCEPTION]: | |
| 19 return True | |
| 20 return mail.MailNotifier.isMailNeeded(self, build, results) | |
| OLD | NEW |