Commit 3206cc0
committed
(#732) run.rb: Combine stderr and stdout
By default, `Puppet::Util::Execution.execute` only returns stdout.
Puppet writes errors to stderr. When the run task fails, it only shows
the successful output:
```
$ bolt task run puppet_agent::run --targets puppet
Started on puppet...
Finished on puppet:
Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Notice: Requesting catalog from puppet.spirit-int.betadots.training:8140 (10.0.1.1)
Notice: Catalog compiled by puppet.spirit-int.betadots.training
*long json here*
```
With the patch:
```
$ bolt task run puppet_agent::run --targets puppet
Started on puppet...
Finished on puppet:
Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Notice: Requesting catalog from puppet.spirit-int.betadots.training:8140 (10.0.1.1)
Notice: Catalog compiled by puppet.spirit-int.betadots.training
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Failed to execute '/pdb/query/v4' on at least 1 of the following 'server_urls': https://puppetdb:8081 (file: /opt/puppetlabs/puppet/modules/infrastructure/manifests/puppet/puppetserver.pp, line: 11, column: 14) on node puppet.spirit-int.betadots.training
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
*long json here*
``1 parent 26310e3 commit 3206cc0
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
| 159 | + | |
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
| |||
0 commit comments