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

Class LoggedRemoteCommand

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

Known Subclasses:

I am a RemoteCommand which gathers output from the remote command into one or more local log files. My self.logs dictionary contains references to these buildbot.status.builder.LogFile instances. Any stdout/stderr/header updates from the slave will be put into self.logs['stdio'], if it exists. If the remote command uses other log files, they will go into other entries in self.logs.

If you want to use stdout or stderr, you should create a LogFile named 'stdio' and pass it to my useLog() message. Otherwise stdout/stderr will be ignored, which is probably not what you want.

Unless you tell me otherwise, when my command completes I will close all the LogFiles that I know about.
Method Summary
  __init__(self, *args, **kwargs)
  addHeader(self, data)
  addStderr(self, data)
  addStdout(self, data)
  addToLog(self, logname, data)
  remoteComplete(self, maybeFailure)
Subclasses can override this.
  remoteUpdate(self, update)
twisted.internet.defer.Deferred start(self)
Tell the slave to start executing the remote command.
  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
  logs: maps logname to a LogFile instance
    Inherited from RemoteCommand
boolean active: whether the command is currently running

Class Variable Summary
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

remoteComplete(self, maybeFailure)

Subclasses can override this.

This is called when the RemoteCommand has finished. 'maybeFailure' will be None if the command completed normally, or a Failure instance in one of the following situations:
  • the slave was lost before the command was started
  • the slave didn't respond to the startCommand message
  • the slave raised an exception while starting the command (bad command name, bad args, OSError from missing executable)
  • the slave raised an exception while finishing the command (they send back a remote_complete message with a Failure payload)
and also (for now):
  • slave disconnected while the command was running
This method should do cleanup, like closing log files. It should normally return the 'failure' argument, so that any exceptions will be propagated to the Step. If it wants to consume them, return None instead.
buildbot.process.buildstep.RemoteCommand.remoteComplete (inherited documentation)


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.RemoteCommand.start (inherited documentation)

useLog(self, loog, closeWhenFinished=False, logfileName=None)

Start routing messages from a remote logfile to a local LogFile

I take a local ILogFile instance in 'loog', and arrange to route remote log messages for the logfile named 'logfileName' into it. By default this logfileName comes from the ILogFile itself (using the name by which the ILogFile will be displayed), but the 'logfileName' argument can be used to override this. For example, if logfileName='stdio', this logfile will collect text from the stdout and stderr of the command.
loog - an instance which implements ILogFile
closeWhenFinished - a boolean, set to False if the logfile will be shared between multiple RemoteCommands. If True, the logfile will be closed when this ShellCommand is done with it.
logfileName - a string, which indicates which remote log file should be routed into this ILogFile. This should match one of the keys of the logfiles= argument to ShellCommand.

Instance Variable Details


maps logname to a LogFile instance

Class Variable Details





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