Package buildbot :: Package process :: Module buildstep :: Class RemoteShellCommand
[frames] | no frames]

Class RemoteShellCommand

source code

 twisted.spread.jelly.Jellyable --+                
                                  |                
twisted.spread.flavors.Serializable --+            
                                      |            
   twisted.spread.flavors.Referenceable --+        
                                          |        
                              RemoteCommand --+    
                                              |    
                            LoggedRemoteCommand --+
                                                  |
                                                 RemoteShellCommand

This class helps you run a shell command on the build slave. It will accumulate all the command's output into a Log named 'stdio'. When the command is finished, it will fire a Deferred. You can then check the results of the command and parse the output however you like.

Instance Methods
 
__init__(self, workdir, command, env=None, want_stdout=1, want_stderr=1, timeout=1200, maxTime=None, logfiles={}, usePTY='slave-config', logEnviron=True) source code
twisted.internet.defer.Deferred
start(self)
Tell the slave to start executing the remote command.
source code
 
__repr__(self) source code

Inherited from LoggedRemoteCommand: addHeader, addStderr, addStdout, addToLog, remoteComplete, remoteUpdate, useLog, useLogDelayed

Inherited from RemoteCommand: interrupt, remote_complete, remote_update, run

Inherited from twisted.spread.flavors.Referenceable: jellyFor, remoteMessageReceived

Inherited from twisted.spread.flavors.Serializable: processUniqueID

Inherited from twisted.spread.jelly.Jellyable: __providedBy__, getStateFor

Class Variables

Inherited from LoggedRemoteCommand: debug, rc

Inherited from RemoteCommand: commandCounter

Inherited from twisted.spread.flavors.Referenceable: __implemented__, __provides__, perspective

Instance Variables

Inherited from LoggedRemoteCommand: logs

Inherited from RemoteCommand: active

Method Details

__init__(self, workdir, command, env=None, want_stdout=1, want_stderr=1, timeout=1200, maxTime=None, logfiles={}, usePTY='slave-config', logEnviron=True)
(Constructor)

source code 
Parameters:
  • workdir (string) - directory where the command ought to run, relative to the Builder's home directory. Defaults to '.': the same as the Builder's homedir. This should probably be '.' for the initial 'cvs checkout' command (which creates a workdir), and the Build-wide workdir for all subsequent commands (including compiles and 'cvs update').
  • command (list of strings (or string)) - the shell command to run, like 'make all' or 'cvs update'. This should be a list or tuple which can be used directly as the argv array. For backwards compatibility, if this is a string, the text will be given to '/bin/sh -c %s'.
  • env (dict of string->string) - environment variables to add or change for the slave. Each command gets a separate environment; all inherit the slave's initial one. TODO: make it possible to delete some or all of the slave's environment.
  • want_stdout (bool) - defaults to True. Set to False if stdout should be thrown away. Do this to avoid storing or sending large amounts of useless data.
  • want_stderr (bool) - False if stderr should be thrown away
  • timeout (int) - tell the remote that if the command fails to produce any output for this number of seconds, the command is hung and should be killed. Use None to disable the timeout.
  • logEnviron - whether to log env vars on the slave side
  • maxTime (int) - tell the remote that if the command fails to complete in this number of seconds, the command should be killed. Use None to disable maxTime.
Overrides: RemoteCommand.__init__

start(self)

source code 

Tell the slave to start executing the remote command.

Returns: twisted.internet.defer.Deferred
a deferred that will fire when the remote command is done (with None as the result)
Overrides: RemoteCommand.start
(inherited documentation)

__repr__(self)
(Representation operator)

source code 
Overrides: LoggedRemoteCommand.__repr__