[Buildbot-commits] buildbot/buildbot/status words.py,1.29,1.30

Brian Warner warner at users.sourceforge.net
Sat Dec 4 21:18:26 UTC 2004


Update of /cvsroot/buildbot/buildbot/buildbot/status
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17516/buildbot/status

Modified Files:
	words.py 
Log Message:
(IrcStatusBot.command_STOP): add a 'stop build' command to the IRC bot


Index: words.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/words.py,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- words.py	28 Nov 2004 05:20:23 -0000	1.29
+++ words.py	4 Dec 2004 21:18:24 -0000	1.30
@@ -256,6 +256,35 @@
         d.addCallback(self.buildFinished, reply)
     command_FORCE.usage = "force build <which> <reason> - Force a build"
 
+    def command_STOP(self, user, reply, args):
+        args = args.split(None, 2)
+        if len(args) < 3 or args[0] != 'build':
+            raise UsageError, "try 'stop build WHICH <REASON>'"
+        which = args[1]
+        reason = args[2]
+
+        buildercontrol = self.getControl(which)
+
+        who = None
+        r = "stopped: by IRC user <%s>: %s" % (user, reason)
+
+        # find an in-progress build
+        builderstatus = self.getBuilder(which)
+        buildstatus = builderstatus.getCurrentBuild()
+        if not buildstatus:
+            self.reply(reply, "sorry, no build is currently running")
+            return
+        num = buildstatus.getNumber()
+
+        # obtain the BuildControl object
+        buildcontrol = buildercontrol.getBuild(num)
+
+        # make it stop
+        bc.stopBuild(r)
+
+        self.reply(reply, "build %d interrupted" % num)
+    command_STOP.usage = "stop build <which> <reason> - Stop a running build"
+
     def emit_status(self, reply, which):
         b = self.getBuilder(which)
         str = "%s: " % which





More information about the Commits mailing list