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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: PUP 3.7.5
    • Fix Version/s: PUP 3.8.1, PUP 4.1.0
    • Component/s: Language
    • Labels:
      None
    • Template:
    • Epic Link:
    • Story Points:
      1
    • Sprint:
      Language 2015-05-13
    • Release Notes:
      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

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  david.roberts Dave Roberts
                  QA Contact:
                  Kurt Wall
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: