Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-6587

`puppet module search --render-as json` returns non-JSON first line on stdout

    Details

    • Type: Bug
    • Status: Ready for Engineering
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: PMT
    • Labels:
      None
    • Template:
    • Acceptance Criteria:
      Hide

      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

      current workaround:
      puppet module search puppetlabs-ntp --render-as json | tail -n +2 | python -m json.tool

      Show
      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 current workaround: puppet module search puppetlabs-ntp --render-as json | tail -n +2 | python -m json.tool
    • Team:
      Puppet Developer Experience

      Description

      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.

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Unassigned
                Reporter:
                jeremy Jeremy Adams
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Zendesk Support