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

freeze_main setting breaks when used with type aliases

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 5.5.2
    • Component/s: None
    • Labels:
      None
    • Template:
      PUP Bug Template
    • Sub-team:
    • Team:
      Platform Core
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      When using {{--freeze_main}} there were circumstances when this would cause an error even if there were no code loading resulting in a modification of the main loaded logic.
    • QA Risk Assessment:
      Needs Assessment

      Description

      The freeze_main setting throws an error when used with code containing type aliases.

      Reproduction:

      mkdir -p test/modules test/manifests
      puppet module install --modulepath test/modules puppetlabs-stdlib
      puppet module install --modulepath test/modules puppetlabs-haproxy
      echo 'include haproxy; notify { "test": }' > test/manifests/site.pp
      puppet apply --modulepath test/modules --freeze_main test/manifests/site.pp --noop
      

      This error will be thrown:

      Error: Evaluation Error: Error while evaluating a Type-Name, Cannot have code outside of a class/node/define because 'freeze_main' is enabled at /Users/reidmv/tmp/modules/haproxy/manifests/init.pp:123:3 on node halcyon.corp.puppetlabs.net
      

      The line number reported is this one:

      class haproxy (
        ...
        Stdlib::Absolutepath $config_dir                             = $haproxy::params::config_dir,
        ...
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              reid Reid Vandewiele
              Reporter:
              reid Reid Vandewiele
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support