puppetlabs / puppet-enterprise_issues

This repository will allow public community members to file bug reports against Puppet Enterprise
1 stars 0 forks source link

Orchestrator manipulates task output #27

Open bastelfreak opened 4 months ago

bastelfreak commented 4 months ago

Describe the Bug

The orchestrator manipulates the result/output from tasks. I was told the best practice is to use json output. That's also what the majority of the Puppet tasks do. When executed on the CLI via puppet task run several characters are stripped:

# puppet task run facts --nodes=puppet
Starting job ...
Note: The task will run only on permitted nodes.
New job ID: 16
Nodes: 1

Started on puppet ...
-
|

Finished on node puppet
  staging_http_get : curl
  pe_minor_version : 7
  processor2 : AMD EPYC Processor
  mtu_eth0 : 1500
  network6_eth0 : 2a01:4f8:1c17:71b6::
...

I think that makes the output harder to read and impossible to parse, because the output is unpredictable. The PE console displays the data less manipulated, but still manipulated:

2024-04-16_15-12

There is whitespace injected before each :. While this is still valid JSON, it looks quite odd and this representation doesn't seem to be common. Also as I user I wouldn't expect that the output is manipulated.

Expected Behavior

Display the task output in the original form, without manipulation. As this would be a breaking change for the CLI, I would be fine with another value for --format, like --format=original.

Steps to Reproduce

Environment

Additional Context

This is a followup of a slack discussion from yesterday (2024-04-15)

Sharpie commented 4 months ago

The puppet task command defaults to --format human which tries to display the output in a form that is easier for humans to read.

For machine parsable output, use: puppet task run --format json ...