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

Class RemoteShellCommand

Jellyable --+                
 Serializable --+            
    Referenceable --+        
        RemoteCommand --+    
      LoggedRemoteCommand --+

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.
Method Summary
  __init__(self, workdir, command, env, want_stdout, want_stderr, timeout, logfiles, **kwargs)
twisted.internet.defer.Deferred start(self)
Tell the slave to start executing the remote command.
    Inherited from LoggedRemoteCommand
  addHeader(self, data)
  addStderr(self, data)
  addStdout(self, data)
  addToLog(self, logname, data)
  remoteComplete(self, maybeFailure)
Subclasses can override this.
  remoteUpdate(self, update)
  useLog(self, loog, closeWhenFinished, logfileName)
Start routing messages from a remote logfile to a local LogFile
    Inherited from RemoteCommand
  interrupt(self, why)
None remote_complete(self, failure)
Called by the slave's to notify me the remote command has finished.
  remote_update(self, updates)
I am called by the slave's so I can receive updates from the running remote command.
  run(self, step, remote)
    Inherited from Referenceable
  jellyFor(self, jellier)
  remoteMessageReceived(self, broker, message, args, kw)
A remote message has been received.
    Inherited from Serializable
Return an ID which uniquely represents this object for this process.
    Inherited from Jellyable
  getStateFor(self, jellier)

Instance Variable Summary
    Inherited from LoggedRemoteCommand
  logs: maps logname to a LogFile instance
    Inherited from RemoteCommand
boolean active: whether the command is currently running

Class Variable Summary
    Inherited from LoggedRemoteCommand
bool debug = False
NoneType rc = None                                                                  
    Inherited from RemoteCommand
list of one int commandCounter: provides a unique value for each RemoteCommand executed across all slaves
    Inherited from Referenceable
Implements __implemented__ = <implementedBy twisted.spread.flavors....
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...
NoneType perspective = None                                                                  
    Inherited from Jellyable
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...

Method Details

__init__(self, workdir, command, env=None, want_stdout=1, want_stderr=1, timeout=1200, logfiles={}, **kwargs)

workdir - 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 - 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'.
           (type=list of strings (or string))
env - 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.
           (type=dict of string->string)
want_stdout - 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 - False if stderr should be thrown away
timeout - 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.


Tell the slave to start executing the remote command.
a deferred that will fire when the remote command is done (with None as the result)
buildbot.process.buildstep.LoggedRemoteCommand.start (inherited documentation)

Generated by Epydoc 2.1 on Sun Dec 10 22:04:45 2006