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

Fix inconsistent autoload of environment functions and pcore types.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 4.8.1
    • Fix Version/s: PUP 4.9.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Epic Link:
    • Team:
      Puppet Developer Experience
    • Story Points:
      1
    • Sprint:
      PDE 2017-01-11
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      The feature that allows functions to defined in an environment in the "environment::" name space has been modified because the implementation was inconsistent between ruby and puppet based functions in this respect. Now, a file containing the definition of a function in an environment is always under a directory reflecting the name space.
      Show
      The feature that allows functions to defined in an environment in the "environment::" name space has been modified because the implementation was inconsistent between ruby and puppet based functions in this respect. Now, a file containing the definition of a function in an environment is always under a directory reflecting the name space.
    • QA Risk Assessment:
      Automate
    • QA Risk Assessment Reason:
      high risk, pp functions not loading in some cases

      Description

      When a ruby function is declared in a func_name.rb file under the directory <env_root>/lib/puppet/functions, the auto-loader makes it accessible using the global name "func_name". Declaring a puppet function in func_name.pp under <env_root>/functions does, however, not work. The function is not found unless the name of the function is prefixed with "environment::". In contrast, if the ruby function is prefixed the same way, the function is no longer found unless it is also moved to <env_root>/lib/puppet/functions/environment.

      For the sake of consistency, functions using global names should reside under:
      <env_root>/lib/puppet/functions # ruby
      <env_root>/functions # puppet

      and functions prefixed with "environment::" should reside under:
      <env_root>/lib/puppet/functions/environment # ruby
      <env_root>/functions/environment # puppet

      The same scheme should be used for auto-loading pcore types that are declared in the environment (but beneath the types directory instead of functions).

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              thomas.hallgren Thomas Hallgren
              QA Contact:
              Eric Thompson
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support