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

Relative namespacing of class/define names results in big surprises

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Template:

      Description

      Due to Puppet's relative namespacing of class names, `include bar` does not mean "declare class `bar`." It actually means "try to declare class `<current namespace>::bar`, class `<parent of current namespace>::bar`, and so on, declaring class `bar` only as a last resort."

      class bar {
        notice("From class bar")
      }
      class foo::bar {
        notice("From class foo::bar")
      }
      class foo {
        include bar
      }
      include foo
      

      This is maximally surprising, especially considering the prevalence of things like:

      class apache::nagios {
        include nagios # joke's on you, because this just includes apache::nagios again
      }
      

      (Test code from original report: <http://pastie.org/409446>)

        Attachments

          Issue Links

            Activity

            Hide
            henrik.lindberg Henrik Lindberg added a comment -

            This is a duplicate of PUP-121 where a decision has been made to deprecate relative namespacing

            Show
            henrik.lindberg Henrik Lindberg added a comment - This is a duplicate of PUP-121 where a decision has been made to deprecate relative namespacing

              People

              • Assignee:
                chuck Charlie Sharpsteen
                Reporter:
                redmine.exporter redmine.exporter
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support