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

defined() function returns wrong value for global variable check

    Details

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

      Description

      The defined function cannot handle global references

      Looking up a variable through a fully qualified name fails:

      • if defined('$::lsbdistcodename') -> false
      • if defined('$lsbdistcodename') -> true

      This is because the logic in scope exists? is different than the logic for lookup_qualified_variable.

      Setting this higher than normal since a defined of $foo is different than a defined of $::foo.

      This was reported first in PUP-4066

      Fixing this requires caution to not introduce regressions.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support