コード例 #1
0
    def performAction(self, req):
        authz = self.getAuthz(req)
        res = yield authz.actionAllowed('stopAllBuilds', req)
        if not res:
            defer.returnValue(path_to_authzfail(req))
            return

        builders = None
        if self.selectedOrAll == 'all':
            builders = self.status.getBuilderNames()
        elif self.selectedOrAll == 'selected':
            builders = [b for b in req.args.get("selected", []) if b]

        for bname in builders:
            builder_status = self.status.getBuilder(bname)
            (state, current_builds) = builder_status.getState()
            if state != "building":
                continue
            for b in current_builds:
                build_status = builder_status.getBuild(b.number)
                if not build_status:
                    continue
                build = StatusResourceBuild(build_status)
                build.stop(req, auth_ok=True)

        # go back to the welcome page
        defer.returnValue(path_to_root(req))
コード例 #2
0
    def performAction(self, req):
        authz = self.getAuthz(req)
        res = yield authz.actionAllowed('stopAllBuilds', req)
        if not res:
            defer.returnValue(path_to_authzfail(req))
            return

        builders = None
        if self.selectedOrAll == 'all':
            builders = self.status.getBuilderNames()
        elif self.selectedOrAll == 'selected':
            builders = [b for b in req.args.get("selected", []) if b]

        for bname in builders:
            builder_status = self.status.getBuilder(bname)
            (state, current_builds) = builder_status.getState()
            if state != "building":
                continue
            for b in current_builds:
                build_status = builder_status.getBuild(b.number)
                if not build_status:
                    continue
                build = StatusResourceBuild(build_status)
                build.stop(req, auth_ok=True)

        # go back to the welcome page
        defer.returnValue(path_to_root(req))
コード例 #3
0
ファイル: builder.py プロジェクト: brasse/buildbot
    def stopall(self, req):
        authz = self.getAuthz(req)
        if not authz.actionAllowed("stopAllBuilds", req):
            return Redirect(path_to_authfail(req))

        for bname in self.status.getBuilderNames():
            builder_status = self.status.getBuilder(bname)
            (state, current_builds) = builder_status.getState()
            if state != "building":
                continue
            for b in current_builds:
                build_status = builder_status.getBuild(b.number)
                if not build_status:
                    continue
                build = StatusResourceBuild(build_status)
                build.stop(req, auth_ok=True)
        # go back to the welcome page
        return Redirect(path_to_root(req))
コード例 #4
0
    def stopall(self, req):
        authz = self.getAuthz(req)
        if not authz.actionAllowed('stopAllBuilds', req):
            return Redirect(path_to_authfail(req))

        for bname in self.status.getBuilderNames():
            builder_status = self.status.getBuilder(bname)
            (state, current_builds) = builder_status.getState()
            if state != "building":
                continue
            for b in current_builds:
                build_status = builder_status.getBuild(b.number)
                if not build_status:
                    continue
                build = StatusResourceBuild(build_status)
                build.stop(req, auth_ok=True)
        # go back to the welcome page
        return Redirect(path_to_root(req))
コード例 #5
0
ファイル: builder.py プロジェクト: binoc-software/mozilla-cvs
 def stop(self, req):
     for bname in self.status.getBuilderNames():
         builder_status = self.status.getBuilder(bname)
         builder_control = None
         c = self.getControl(req)
         if c:
             builder_control = c.getBuilder(bname)
         (state, current_builds) = builder_status.getState()
         if state != "building":
             continue
         for b in current_builds:
             build_status = builder_status.getBuild(b.number)
             if not build_status:
                 continue
             if builder_control:
                 build_control = builder_control.getBuild(b.number)
             else:
                 build_control = None
             build = StatusResourceBuild(build_status, build_control,
                                         builder_control)
             build.stop(req)
     return Redirect("../../waterfall")
コード例 #6
0
 def stop(self, req):
     for bname in self.status.getBuilderNames():
         builder_status = self.status.getBuilder(bname)
         builder_control = None
         c = self.getControl(req)
         if c:
             builder_control = c.getBuilder(bname)
         (state, current_builds) = builder_status.getState()
         if state != "building":
             continue
         for b in current_builds:
             build_status = builder_status.getBuild(b.number)
             if not build_status:
                 continue
             if builder_control:
                 build_control = builder_control.getBuild(b.number)
             else:
                 build_control = None
             build = StatusResourceBuild(build_status, build_control,
                                         builder_control)
             build.stop(req)
     return Redirect("../../waterfall")
コード例 #7
0
ファイル: build.py プロジェクト: rpavlik/jhbuild-vrjuggler
 def getChild(self, path, req):
     if path == 'steps':
         return JhStepsResource(self.build_status)
     return StatusResourceBuild.getChild(self, path, req)
コード例 #8
0
 def getChild(self, path, req):
     if path == 'steps':
         return JhStepsResource(self.build_status)
     return StatusResourceBuild.getChild(self, path, req)