Uploaded image for project: 'Puppet Server'
  1. Puppet Server
  2. SERVER-1570

puppet4 function generate() should throw exception when command fails

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: SERVER 2.7.0
    • Component/s: Puppet Server
    • Labels:
    • Environment:
    • Template:
    • Team:
      Systems Engineering
    • Sub-team:
    • Story Points:
      3
    • Sprint:
      SE 2016-10-05
    • CS Priority:
      Reviewed
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      The {{generate()}} function is supposed to throw an exception when the executed command returns a non-zero exit code. In versions of Puppet Server prior to 2.7.0, it did not, and this behavior was not consistent with the MRI/Rack versions of the Puppet master. This bug is fixed in 2.7.0.
      Show
      The {{generate()}} function is supposed to throw an exception when the executed command returns a non-zero exit code. In versions of Puppet Server prior to 2.7.0, it did not, and this behavior was not consistent with the MRI/Rack versions of the Puppet master. This bug is fixed in 2.7.0.

      Description

      description

      The function generate() does not throw a parse failure as stated in the documentation when the master is running puppet4. It works as expected on a v3 master, or using puppet apply:

      class manifests::test_util_exec {
        $_msg = generate('/bin/false')
        notify { 'test_util_exec':
          message => $_msg
        }
      }
      

      puppet4 master

      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Loading facts
      Info: Caching catalog for MYNODE.mygtld
      Info: Applying configuration version '1471337073'
      Notice:
      Notice: /Stage[main]/Manifests::Test_util_exec/Notify[test_util_exec]/message: defined 'message' as ''
      Notice: Finished catalog run in 34.14 seconds
      

      puppet 3 master

      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Loading facts
      Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to execute generator /bin/false: Execution of '/bin/false' returned 1:  at /etc/puppet/environments/MYENV/manifests/test_util_exec.pp:2 on node MYNODE.mygtld
      Warning: Not using cache on failed catalog
      Error: Could not retrieve catalog; skipping run
      

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  chris Chris Price
                  Reporter:
                  faxmodem Fabien Wernli
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: