puppetlabs/puppet-acceptance — pull request #237 by nicklewis (2012-06-12 21:37:45+00:00)
Title: Command refactors

This pull request consists of some refactors to the way commands are handled. Primarily, it moves command execution to an SshConnection object (which belongs to Host). Evaluation of the result of a command belongs to a Host. Also, the global Log class has been replaced with a Logger class which is instantiated by the TestSuite for logging. Log is still available for backward compatibility, as a reference to the instance, but tests referring to it should be migrated as soon as possible.

There are also significant changes to the format of command output. Rather than RemoteExec(["command name"]), and splitting stdout and stderr, delimiting them with tags, we now emulate the output of a shell session. The "prompt" contains the name of the machine the command is executing on, the command itself, and then the output following that. If the exit code is non-zero, it will be noted in a line following the output. The distinction between stdout/stderr is maintained in code, so that tests can depend on it, but it doesn't seem to be of particular value when printing to the user, compared to the value of keeping the output in its actual order.