diff --git a/master/buildbot/process/buildstep.py b/master/buildbot/process/buildstep.py index 89bfa488df2..638065345c9 100644 --- a/master/buildbot/process/buildstep.py +++ b/master/buildbot/process/buildstep.py @@ -389,12 +389,25 @@ def start(self): raise NotImplementedError("your subclass must implement run()") def interrupt(self, reason): + # TODO: consider adding an INTERRUPTED or STOPPED status to use + # instead of FAILURE, might make the text a bit more clear. + # 'reason' can be a Failure, or text self.stopped = True if self._acquiringLock: lock, access, d = self._acquiringLock lock.stopWaitingUntilAvailable(self, access, d) d.callback(None) + if self._step_status.isWaitingForLocks(): + self.addCompleteLog( + 'interrupt while waiting for locks', str(reason)) + else: + self.addCompleteLog('interrupt', str(reason)) + + if self.cmd: + d = self.cmd.interrupt(reason) + d.addErrback(log.err, 'while interrupting command') + def releaseLocks(self): log.msg("releaseLocks(%s): %s" % (self, self.locks)) for lock, access in self.locks: @@ -683,21 +696,6 @@ def setupLogfiles(self, cmd, logfiles): # and tell the RemoteCommand to feed it cmd.useLog(newlog, True) - def interrupt(self, reason): - # TODO: consider adding an INTERRUPTED or STOPPED status to use - # instead of FAILURE, might make the text a bit more clear. - # 'reason' can be a Failure, or text - BuildStep.interrupt(self, reason) - if self._step_status.isWaitingForLocks(): - self.addCompleteLog( - 'interrupt while waiting for locks', str(reason)) - else: - self.addCompleteLog('interrupt', str(reason)) - - if self.cmd: - d = self.cmd.interrupt(reason) - d.addErrback(log.err, 'while interrupting command') - def checkDisconnect(self, f): # this is now handled by self.failed log.msg("WARNING: step %s uses deprecated checkDisconnect method")