def __init__(self, stream, raw_event): self.id = utils.get_rnd_name(prefix="", length=10) self.stream = stream self.root = stream.root self.raw_event = raw_event self.project_name = self.get_project_name(raw_event) self.jobs = {} self.jobs_list = [] self.cfg = self.root.config.data["project"][self.project_name] for job_name in self.cfg.get("jobs", []): self.jobs_list.append(Job(self, job_name)) for job_name in self.cfg.get("non-voting-jobs", []): job = Job(self, job_name) job.voting = False self.jobs_list.append(job)
def _prepare_job(self, job_name, voting=True): cfg = self.config.data["jobs"][job_name] LOG.debug("Preparing job %s (id %s)" % (job_name, self.id)) job = Job(self, job_name, cfg, self.event) job.voting = voting LOG.debug("Prepared job %r" % job) self.jobs.append(job)