Resolution: Won't Fix
Affects Version/s: None
Fix Version/s: None
puppet module search puppetlabs-ntp --render-as json | python -m json.tool
should return pretty-printed JSON
currently it returns:
No JSON object could be decoded
puppet module search puppetlabs-ntp --render-as json | tail -n +2 | python -m json.tool
Team:Puppet Developer Experience
As a user wanting to parse JSON returned from puppet module tool,
I need puppet module tool to return only JSON on stdout so I can pipe it to the
next tool in my pipeline such as jq.
Currently two lines are returned on stdout. The second line contains the JSON output, while, the first line is:
Notice: Searching https://forgeapi.puppetlabs.com ...
That line should not appear on stdout.
To make the JSON parseable, you need to strip off the first line, currently.
Since a lot of JSON is returned to the screen, it wasn't clear at first what the problem was.
A possible solution would be to return the Notice: Searching https://forgeapi.puppetlabs.com ...
message on stderr instead of stdout.