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

"puppet config print" should only emit diagnostic info when run with verbose or higher



    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 5.5.0
    • Fix Version/s: PUP 5.5.1
    • Component/s: None
    • Labels:
    • Template:
    • Team:
    • Sprint:
      Platform Core KANBAN
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Extra information for puppet config print will now only be shown with verbose or debug options.
    • QA Risk Assessment:
      Needs Assessment


      While the enhancements implemented in PUP-2868 are arguably good, because they make puppet config print less confusing for novice users, making puppet config print unconditionally emit messages to stderr is undesirable, as the extraneous stderr messages can confuse programs which are using puppet config print non-interactively and are parsing the output.

      Case in point: I have multiple cron jobs that use puppet config print to obtain Puppet configuration information. After upgrading to 5.5.0, I am now receiving messages like this on an hourly basis:

      From: "(Cron Daemon)" <root@example.org>
      To: root@example.org
      Subject: Cron <root@myhost> run-parts /etc/cron.hourly
      Date: Wed, 21 Mar 2018 13:01:01 -0400
      Resolving settings from section 'master' in environment 'production'

      Sure, I can rewrite the cron scripts in question to redirect stderr to /dev/null. But if I do this, I will lose legitimate error messages that puppet config print might generate. So simply discarding stderr entirely is not a good solution.

      The real problem here is that PUP-2868 violated one of the core tenets of good user interface design, which is: if you are going to make something be verbose by default, then you must provide a mechanism to disable that verbosity.

      Simply put, puppet config print needs a --quiet option, which disables all output to stderr except for error (and arguably warning) messages.

      (Whether --quiet should disable warnings is something of a religious argument, but in this case, I'm not sure it matters, as using --section should prevent puppet config print from issuing any warnings.)

      So, in summary, while making puppet config print verbose by default was arguably a good idea, there must be a mechanism to disable that verbosity, in cases where puppet config print is being used programmatically, and verbosity is unwanted.


          Issue Links



              kris.bosland Kris Bosland
              ralston James Ralston
              1 Vote for this issue
              9 Start watching this issue



                  Zendesk Support