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

4x functions in modules are broken

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: PUP 3.7.1
    • Fix Version/s: None
    • Component/s: Modules
    • Labels:
      None
    • Template:

      Description

      Commit 0447ea02 changed the function path for 4x functions:

      -    FUNCTION_PATH_4X = File.join('lib', 'puppet', 'functions')
      +    FUNCTION_PATH_4X = File.join('puppet', 'functions')
      

      Now it's not possible to load 4x functions from modules as the loader returns a path such as: <module dir>/lib/puppet/functions, even for 4x functions.

      I can make it work with this change:

      diff --git a/lib/puppet/pops/loader/module_loaders.rb b/lib/puppet/pops/loader/module_loaders.rb
      index 3edd515..9588861 100644
      --- a/lib/puppet/pops/loader/module_loaders.rb
      +++ b/lib/puppet/pops/loader/module_loaders.rb
      @@ -38,7 +38,7 @@ module Puppet::Pops::Loader::ModuleLoaders
           Puppet::Pops::Loader::ModuleLoaders::FileBased.new(parent_loader,
                                                              loaders,
                                                              module_name,
      -                                                       File.join(module_path, 'lib'),
      +                                                       module_path,
                                                              module_name)
         end
      

      but my knowledge of puppet internals is poor, so I guess this breaks anything loaded with that particular loader.

      Thanks.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jsanchez Jose Sanchez
                Reporter:
                jsanchez Jose Sanchez
                QA Contact:
                Eric Thompson
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support