saltstack/salt — pull request #2727 by thekuffs (2012-11-28 05:55:05+00:00)
Title: Fix pip.installed error output and add loader debug output

This started out as a pull request to fix the error output for the `pip.installed` state. It turns out that build errors for pip are not passed to stderr, but to stdout. I have added both stderr and stdout to the returned comments if the pip command fails.

While testing this fix I found that the module wouldn't initially load. And frustrated with the lack of feedback from the loader I dove into it and added a bunch of logging. So now there are helpful messages in the debug log like this:

```
[DEBUG ] loading output in ['/var/cache/salt/minion/extmods/output', '/salt/salt-0.10.5.linux-x86_64/salt-0.10.5-py2.6.egg/salt/output']
[DEBUG ] Skipping /var/cache/salt/minion/extmods/output, it is not a directory
[DEBUG ] Added overstatestage.output to output
[DEBUG ] Loaded json_out as virtual json
[DEBUG ] Added json.output to output
[DEBUG ] Added raw.output to output
[DEBUG ] Added highstate.output to output
[DEBUG ] Loaded yaml_out as virtual yaml
[DEBUG ] Added yaml.output to output
[DEBUG ] Added key.output to output
[DEBUG ] Added txt.output to output
[DEBUG ] Loaded pprint_out as virtual pprint
[DEBUG ] Added pprint.output to output
```

I eventually got a bug fixed in the module that was preventing it from being included in my build. But now we have some great logging!

**Please review this pull carefully. I made a few cleanups to the loader logic and I would like someone to verify that I have not missed a case.**