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

honor strict mode and use warn_once for ModuleLoader warning, when module dependencies are missing

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 4.5.0
    • Component/s: Language, Puppet Server
    • Labels:
      None
    • Template:
    • Sub-team:
    • Story Points:
      1
    • Sprint:
      Server Emerald 2016-04-20
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      Warnings from ModuleLoader regarding unresolved module dependencies are now controlled by the Puppet --strict setting. When set to 'off', no warnings or errors are produced for unresolved dependencies, and when set to 'warning' one warning per unresolved module is issued per lifetime of a compile service. When set to error, compilation will stop with an error.
      Show
      Warnings from ModuleLoader regarding unresolved module dependencies are now controlled by the Puppet --strict setting. When set to 'off', no warnings or errors are produced for unresolved dependencies, and when set to 'warning' one warning per unresolved module is issued per lifetime of a compile service. When set to error, compilation will stop with an error.

      Description

      The code that loads modules currently looks to see if they have a forge metadata.json file, and if so, validates that the dependencies are all installed. If any dependencies are missing (which is not uncommon for r10k users), then a warning is logged each time the environment is loaded. For the default configuration with environment_timeout = 0, this means that the warning is logged on every catalog compilation.

      Some users have indicated that this is causing their logs to grow very large. After discussion with Henrik Lindberg, the proposed change is:

      1. if strict mode is :off - log nothing
      2. if strict mode is :warning - call warn_once, so that the warning is only logged once (per jruby instance)
      3. if strict mode is :error - throw an error and fail compilation

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                chris Chris Price
                Reporter:
                chris Chris Price
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: