juju/utils — pull request #91 by dimitern (2014-11-20 12:41:37+00:00)
Title: Fixed lp:1394524 - apt-get retry should not call CombinedOutput twice

When you call exec.Command's CombinedOutput() method more than once
it will fail with an error - "exec: Stdout already set". The way
apt-get command was tested this wasn't exercised because of the
CommandOutput mock used.

This PR adds a new test to actually call CombinedOutput() on the
apt-get command (but first it sets the command and args to empty
to avoid actually running anything) and ensures the "exec: Stdout
already set" error does not happen. The fix was to move the cmd
creation inside the retry loop.