Ejemplo n.º 1
0
    def getPendingBuildRequestControls(self):
        master = self.original.master
        brdicts = yield master.db.buildrequests.getBuildRequests(buildername=self.original.name, claimed=False)

        # convert those into BuildRequest objects
        buildrequests = []
        for brdict in brdicts:
            br = yield buildrequest.BuildRequest.fromBrdict(self.control.master, brdict)
            buildrequests.append(br)

        # and return the corresponding control objects
        defer.returnValue([buildrequest.BuildRequestControl(self.original, r) for r in buildrequests])
Ejemplo n.º 2
0
    def getBuildRequestsBySourcestamps(self,
                                       buildername=None,
                                       sourcestamps=None):
        buildrequests = []

        if sourcestamps:
            for id, row in self.reqs.iteritems():
                br_ss = self.sourcestamps.get(id)
                if self.compare(
                        br_ss, sourcestamps
                ) and buildername and buildername in row.buildername:
                    br = self._brdictFromRow(row)
                    buildrequests.append(br)

        return defer.succeed(buildrequests)
Ejemplo n.º 3
0
    def getPendingBuildRequestControls(self):
        master = self.original.master
        brdicts = yield master.db.buildrequests.getBuildRequests(
                buildername=self.original.name,
                claimed=False)

        # convert those into BuildRequest objects
        buildrequests = [ ]
        for brdict in brdicts:
            br = yield buildrequest.BuildRequest.fromBrdict(
                    self.control.master, brdict)
            buildrequests.append(br)

        # and return the corresponding control objects
        defer.returnValue([ buildrequest.BuildRequestControl(self.original, r)
                            for r in buildrequests ])
Ejemplo n.º 4
0
    def getPendingBuildRequestControls(self):
        master = self.original.master
        wfd = defer.waitForDeferred(
            master.db.buildrequests.getBuildRequests(buildername=self.original.name, claimed=False)
        )
        yield wfd
        brdicts = wfd.getResult()

        # convert those into BuildRequest objects
        buildrequests = []
        for brdict in brdicts:
            wfd = defer.waitForDeferred(buildrequest.BuildRequest.fromBrdict(self.master.master, brdict))
            yield wfd
            buildrequests.append(wfd.getResult())

        # and return the corresponding control objects
        yield [buildrequest.BuildRequestControl(self.original, r) for r in buildrequests]
Ejemplo n.º 5
0
    def getPendingBuildRequestControls(self):
        master = self.original.master
        wfd = defer.waitForDeferred(
            master.db.buildrequests.getBuildRequests(
                buildername=self.original.name,
                claimed=False))
        yield wfd
        brdicts = wfd.getResult()

        # convert those into BuildRequest objects
        buildrequests = [ ]
        for brdict in brdicts:
            wfd = defer.waitForDeferred(
                buildrequest.BuildRequest.fromBrdict(self.master.master,
                                                     brdict))
            yield wfd
            buildrequests.append(wfd.getResult())

        # and return the corresponding control objects
        yield [ buildrequest.BuildRequestControl(self.original, r)
                 for r in buildrequests ]