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

Modules with manifest directories containing 'manifests', 'functions', 'types' or 'plans' fail to load

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Duplicate
    • None
    • None
    • None
    • None
    • Needs Assessment

    Description

      As part of the work for PUP-4242, validation was introduced to check that the name of a definition (class, define, function, type, plan) matches the path to the file it's in. That code works by searching up the ancestry until it finds a directory named one of manifests, functions, types, or plans, and assuming the parent of that directory must be the module.

      That works fine, so long as there isn't a nested directory with one of those names. In that case, the manifest fails validation because its name (though correct) doesn't match what was expected (incorrect).

      For example:

      # modulename/manifests/foo/bar/types/baz.pp
      class modulename::foo::bar::types::baz() { }
      

      This manifest has the correct name, but the validation thinks the module name is bar and that the path to the file is bar/types/baz.pp. Thus, it believes the correct name for the entity defined in the manifest ought to be bar::baz, causing an error.

      Attachments

        Issue Links

          Activity

            People

              kris.bosland Kris Bosland
              nick Nick Lewis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support