This class handles running commands, consisting of a command name and
a dictionary of arguments. If true, ignore_updates will suppress any
updates sent from the slave.

This class handles updates for stdout, stderr, and header by
appending them to a stdio logfile, if one is in use. It handles
updates for rc by recording the value in its rc attribute.

Most slave-side commands, even those which do not spawn a new process on
the slave, generate logs and an rc, requiring this class or one of its
subclasses. See Updates for the updates that each
command may send.

This method attempts to stop the running command early. The Deferred
it returns will fire when the interrupt request is received by the
slave; this may be a long time before the command itself completes, at
which time the Deferred returned from run will fire.

Handles updates from the slave on the running command. See
Updates for the content of the updates. This class
splits the updates out, and handles the ignore_updates option, then
calls remoteUpdate to process the update.

failure -- the failure that caused the step to complete, or None
for success

Called by the slave to indicate that the command is complete. Normal
completion (even with a nonzero rc) will finish with no failure; if
failure is set, then the step should finish with status
EXCEPTION.

If the collectStdout constructor argument is true, then this
attribute will contain all data from stdout, as a single string. This
is helpful when running informational commands (e.g., svnversion),
but is not appropriate for commands that will produce a large amount of
output, as that output is held in memory.

logfileName -- the name of the logfile, as given to the slave.
This is stdio for standard streams.

activateCallback -- callback for when the log is added; see below

closeWhenFinished -- if true, call
finish when the command is
finished.

Similar to useLog, but the logfile is only actually added when
an update arrives for it. The callback, activateCallback, will be
called with the RemoteCommand
instance when the first update for the log is delivered.

With that finished, run the command using the inherited
run method. During the
run, you can inject data into the logfiles with any of these methods:

workdir -- directory in which command should be executed, relative to
the builder's basedir.

command (string or list) -- shell command to run

want_stdout -- If false, then no updates will be sent for stdout.

want_stderr -- If false, then no updates will be sent for stderr.

timeout -- Maximum time without output before the command is killed.

maxTime -- Maximum overall time from the start before the command is
killed.

sigtermTime -- Try to kill the command with SIGTERM and wait for sigtermTime seconds before firing SIGKILL. If None, SIGTERM will not be fired.

env -- A dictionary of environment variables to augment or replace the
existing environment on the slave.

logfiles -- Additional logfiles to request from the slave.

usePTY -- True to use a PTY, false to not use a PTY; the default value
uses the default configured on the slave.

logEnviron -- If false, do not log the environment on the slave.

collectStdout -- If True, collect the command's stdout.

Most of the constructor arguments are sent directly to the slave; see
shell for the details of the formats. The
collectStdout parameter is as described for the parent class.

If shell command contains passwords they can be hidden from log files by passing
them as tuple in command argument. Eg. ['print',('obfuscated','password','dummytext')]
is logged as ['print','dummytext'].

This class is used by the ShellCommand step, and by steps that
run multiple customized shell commands.