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

With strict variables turned on, it is difficult to use built in variables when testing module

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: PUP 3.7.5
    • Component/s: None
    • Labels:
      None
    • Template:
    • Story Points:
      1
    • Sprint:
      Language 2015-03-04, Language 2015-03-18

      Description

      When using --strict_variables, it is difficult to use built in variables $caller_module_name and $module_name since they are typically not defined when running tests on modules.

      To fix this, module authors would have to fake this variable by setting them in scope, or jump through hoops by calling defined("$caller_module_name") before attempting to check this variable.

      We will make sure that these two built in variables are always considered to exist and result in nil/undef when accessed instead of raising an error when --strict_variables is true.

      (And the next person that suggest that built in magic variables is a good idea will be signed up for the perpetual yak shaving service...)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                henrik.lindberg Henrik Lindberg
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support