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

regression: explicit undef cannot be used in create_resources

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • PUP 4.6.1
    • None
    • 2
    • Language 2016-08-24
    • Bug Fix
    • Hide
      A regression made it impossible to give an attribute as {{undef}} when there is no default value expression for a resource parameter and using {{create_resources}} to create the resource. There was no regression when doing the same from a manifest directly.
      Show
      A regression made it impossible to give an attribute as {{undef}} when there is no default value expression for a resource parameter and using {{create_resources}} to create the resource. There was no regression when doing the same from a manifest directly.

    Description

      The following code works when evaluated from a manifest:

      puppet apply -e 'define foo($foo) {} foo { "FOO": foo => undef }'
      

      But not when done using create_resources.

      The rule puppet should use is: if undef is given then use the default value if one exists, otherwise set an explicit undef. Now the create_resources function simply filters out all undef values. (If simply kept, there are other problems since relationships cannot handle undef entries.

      Attachments

        Issue Links

          Activity

            People

              phong Phong Ly
              henrik.lindberg Henrik Lindberg
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support