Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-3432

Bad behavior of getvar() from stdlib when strict_variables is set to true

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Normal
    • Resolution: Unresolved
    • None
    • None
    • stdlib
    • None
    • Modules

    Description

      I have Puppet version 4.4.1 and Puppetlabs-stdlib version 4.11.0 and, when strict_variables is set to true in puppet.conf, I have this:

      ~# puppet apply -e '$var = getvar("stuff::which::doesnt::exist"); notice( $var ); notice( $var =~ String[1] )'
      Notice: Scope(Class[main]): class stuff::which::doesnt could not be found
      Notice: Scope(Class[main]): true
      Notice: Compiled catalog for puppet.athome.priv in environment production in 0.14 seconds
      Notice: Applied catalog in 0.13 seconds
      

      $var is set to a non-empty and not relevant string.

      If strict_variables is set to false in puppet.conf, the behavior seems to be the expected behavior (ie $var is undef):

      ~# puppet apply -e '$var = getvar("stuff::which::doesnt::exist"); notice( $var ); notice( $var =~ Undef )'
      Warning: Undefined variable 'stuff::which::doesnt::exist'; class stuff::which::doesnt could not be found
         (file & line not available)
      Notice: Scope(Class[main]): 
      Notice: Scope(Class[main]): true
      Notice: Compiled catalog for puppet.athome.priv in environment production in 0.35 seconds
      Notice: Applied catalog in 0.13 seconds
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              flaf Francois Lafont
              Votes:
              3 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:

                Zendesk Support