コード例 #1
0
ファイル: Job.py プロジェクト: gpocentek/rebuildd
    def __setattr__(self, name, value):
        """Override setattr to log build status changes"""

        if name == "status":
            RebuilddLog.info("Job %s for %s_%s on %s/%s changed status from %s to %s"\
                    % (self.id, self.package.name, self.package.version, 
                       self.dist, self.arch,
                       JobStatus.whatis(self.status),
                       JobStatus.whatis(value)))
            self.status_changed = sqlobject.DateTimeCol.now()
        sqlobject.SQLObject.__setattr__(self, name, value)
コード例 #2
0
    def __setattr__(self, name, value):
        """Override setattr to log build status changes"""

        if name == "status":
            RebuilddLog.info("Job %s for %s_%s on %s/%s changed status from %s to %s"\
                    % (self.id, self.package.name, self.package.version, 
                       self.dist, self.arch,
                       JobStatus.whatis(self.status),
                       JobStatus.whatis(value)))
            self.status_changed = sqlobject.DateTimeCol.now()
        sqlobject.SQLObject.__setattr__(self, name, value)
コード例 #3
0
ファイル: Rebuildd.py プロジェクト: kryskool/rebuildd
    def fix_jobs(self, print_result=True):
        """If rebuildd crashed, reset jobs to a valid state"""

        jobs = []
        jobs.extend(Job.selectBy(host=socket.gethostname(), status=JobStatus.WAIT_LOCKED))
        jobs.extend(Job.selectBy(host=socket.gethostname(), status=JobStatus.BUILDING))

        for job in jobs:
            if print_result:
                print "I: Fixing job %s (was %s)" % (job.id, JobStatus.whatis(job.status))
            job.host = None
            job.status = JobStatus.WAIT
            job.build_start = None
            job.build_end = None

        return True
コード例 #4
0
ファイル: Rebuildd.py プロジェクト: YunoHost/rebuildd
    def fix_jobs(self, print_result=True):
        """If rebuildd crashed, reset jobs to a valid state"""

        jobs = []
        jobs.extend(
            Job.selectBy(host=socket.gethostname(),
                         status=JobStatus.WAIT_LOCKED))
        jobs.extend(
            Job.selectBy(host=socket.gethostname(), status=JobStatus.BUILDING))

        for job in jobs:
            if print_result:
                print "I: Fixing job %s (was %s)" % (
                    job.id, JobStatus.whatis(job.status))
            job.host = None
            job.status = JobStatus.WAIT
            job.build_start = None
            job.build_end = None

        return True
コード例 #5
0
ファイル: Job.py プロジェクト: gpocentek/rebuildd
 def __str__(self):
     return "I: Job %s for %s_%s is status %s on %s for %s/%s" % \
             (self.id, self.package.name, self.package.version, self.host,
              JobStatus.whatis(self.status), self.dist, self.arch)
コード例 #6
0
ファイル: Job.py プロジェクト: gpocentek/rebuildd
            self.host = None

            build_log.write("\nBuild job killed on request\n")
            build_log.close()

            return

        # build is finished
        with self.status_lock:
            if state == 0:
                self.status = JobStatus.BUILD_OK

        self.build_end = sqlobject.DateTimeCol.now()

        build_log.write("******************************************************************************\n")
        build_log.write("Finished with status %s at %s\n" % (JobStatus.whatis(self.status), self.build_end))
        build_log.write("Build needed %s\n" % (self.build_end - self.build_start))
        build_log.close()


        # Send event to Rebuildd to inform it that it can
        # run a brand new job!
        if self.notify:
            self.notify.set()

        self.send_build_log()

    def send_build_log(self):
        """When job is built, send logs by mail"""

        try:
コード例 #7
0
 def __str__(self):
     return "I: Job %s for %s_%s is status %s on %s for %s/%s" % \
             (self.id, self.package.name, self.package.version, self.host,
              JobStatus.whatis(self.status), self.dist, self.arch)
コード例 #8
0
            self.host = None

            build_log.write("\nBuild job killed on request\n")
            build_log.close()

            return

        # build is finished
        with self.status_lock:
            if state == 0:
                self.status = JobStatus.BUILD_OK

        self.build_end = sqlobject.DateTimeCol.now()

        build_log.write("******************************************************************************\n")
        build_log.write("Finished with status %s at %s\n" % (JobStatus.whatis(self.status), self.build_end))
        build_log.write("Build needed %s\n" % (self.build_end - self.build_start))
        build_log.close()


        # Send event to Rebuildd to inform it that it can
        # run a brand new job!
        if self.notify:
            self.notify.set()

        self.send_build_log()

    def send_build_log(self):
        """When job is built, send logs by mail"""

        try: