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

Future parser is not correctly handling the default case of a case statement

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Done
    • PUP 3.7.5
    • PUP 3.8.1, PUP 4.1.0
    • Language
    • None
    • Bug Fix

    Description

      According to https://docs.puppetlabs.com/puppet/latest/reference/future_lang_conditional.html#behavior-2 the future parser should always evaluate the default case last; however, that does not seem to be happening. The following code, executed on a VM always returns the default case.

      [root@master ~]# facter is_virtual
      true
      [root@master ~]# cat foo.pp
      case $is_virtual {
        default: { notify { "default case": } }
        true: { notify { "nondefault case": } }
      }
      [root@master ~]# puppet apply foo.pp
      Notice: Compiled catalog for master.inf.puppetlabs.demo in environment production in 0.51 seconds
      Notice: default case
      Notice: /Stage[main]/Main/Notify[default case]/message: defined 'message' as 'default case'
      Notice: Finished catalog run in 0.28 seconds
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              david.roberts Dave Roberts
              Kurt Wall Kurt Wall
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support