Package buildslave :: Module interfaces :: Class ISlaveCommand
[frames] | no frames]

Class ISlaveCommand

source code

zope.interface.Interface --+
                           |
                          ISlaveCommand

This interface is implemented by all of the buildslave's Command subclasses. It specifies how the buildslave can start, interrupt, and query the various Commands running on behalf of the buildmaster.

Instance Methods
 
__init__(builder, stepId, args)
Create the Command.
source code
 
setup(args)
This method is provided for subclasses to override, to extract parameters from the 'args' dictionary.
source code
 
start()
Begin the command, and return a Deferred.
source code
 
interrupt()
This is called to tell the Command that the build is being stopped and therefore the command should be terminated as quickly as possible.
source code
Class Variables
  __bases__ = (<InterfaceClass zope.interface.Interface>)
  __identifier__ = 'buildslave.interfaces.ISlaveCommand'
  __iro__ = (<InterfaceClass buildslave.interfaces.ISlaveCommand...
  __name__ = 'ISlaveCommand'
  __sro__ = (<InterfaceClass buildslave.interfaces.ISlaveCommand...
  dependents = <WeakKeyDictionary at 110050480>
Method Details

__init__(builder, stepId, args)
(Constructor)

source code 

Create the Command. 'builder' is a reference to the parent buildbot.bot.SlaveBuilder instance, which will be used to send status updates (by calling builder.sendStatus). 'stepId' is a random string which helps correlate slave logs with the master. 'args' is a dict of arguments that comes from the master-side BuildStep, with contents that are specific to the individual Command subclass.

This method is not intended to be subclassed.

setup(args)

source code 

This method is provided for subclasses to override, to extract parameters from the 'args' dictionary. The default implemention does nothing. It will be called from __init__

start()

source code 

Begin the command, and return a Deferred.

While the command runs, it should send status updates to the master-side BuildStep by calling self.sendStatus(status). The 'status' argument is typically a dict with keys like 'stdout', 'stderr', and 'rc'.

When the step completes, it should fire the Deferred (the results are not used). If an exception occurs during execution, it may also errback the deferred, however any reasonable errors should be trapped and indicated with a non-zero 'rc' status rather than raising an exception. Exceptions should indicate problems within the buildbot itself, not problems in the project being tested.

interrupt()

source code 

This is called to tell the Command that the build is being stopped and therefore the command should be terminated as quickly as possible. The command may continue to send status updates, up to and including an 'rc' end-of-command update (which should indicate an error condition). The Command's deferred should still be fired when the command has finally completed.

If the build is being stopped because the slave it shutting down or because the connection to the buildmaster has been lost, the status updates will simply be discarded. The Command does not need to be aware of this.

Child shell processes should be killed. Simple ShellCommand classes can just insert a header line indicating that the process will be killed, then os.kill() the child.


Class Variable Details

__iro__

Value:
(<InterfaceClass buildslave.interfaces.ISlaveCommand>,
 <InterfaceClass zope.interface.Interface>)

__sro__

Value:
(<InterfaceClass buildslave.interfaces.ISlaveCommand>,
 <InterfaceClass zope.interface.Interface>)