~notnownikki/offspring/post-build-script

« back to all changes in this revision

Viewing changes to lib/offspring/master/master.py

Merge of lp:~mike-powerthroughwords/offspring/exclude-failing-builders [r=bigkevmcd]

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
from storm.locals import create_database, Desc, Store
12
12
 
13
13
from offspring.daemon import LexbuilderDaemon
 
14
from offspring.enums import ProjectBuildStates
14
15
from offspring.master.exceptions import SlaveCommunicationError
15
16
from offspring.master.models import BuildRequest, Lexbuilder
16
17
from offspring.master import notifications
97
98
        self.is_online = False
98
99
 
99
100
    def _get_builders(self):
100
 
        return self.db_store.find(Lexbuilder, Lexbuilder.is_retired == False)
 
101
        return self.db_store.find(
 
102
            Lexbuilder, Lexbuilder.is_retired == False,
 
103
            Lexbuilder.contiguous_errors <= self.config.getint(
 
104
                "master", "builder_error_limit"))
101
105
 
102
106
    def scanSlaves(self):
103
107
        """
146
150
                                logging.error(
147
151
                                    "PROBLEM DETECTED: A non-fatal problem has"
148
152
                                    " been detected. See above for details.")
 
153
                        if builder.current_job.result == ProjectBuildStates.FAILED:
 
154
                            builder.contiguous_errors += 1
 
155
                        else:
 
156
                            builder.contiguous_errors = 0
149
157
                        builder.current_job = None
150
158
                        self.db_store.commit()
151
159
                    else: