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

Regression: Puppet::Util.default_env method removed in 5.5.21 and 6.17.0

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 5.5.21, PUP 6.17.0
    • Fix Version/s: PUP 5.5.22, PUP 6.18.0
    • Component/s: None
    • Labels:
    • Template:
      PUP Bug Template
    • Team:
      Coremunity
    • Sprint:
      Platform Core KANBAN
    • Method Found:
      Needs Assessment
    • Release Notes:
      Known Issue
    • Release Notes Summary:
      Hide
      Testing modules using rspec-puppet versions earlier than 2.7.10 results in the error "undefined local variable or method `default_env' for Puppet::Util:Module". As a workaround, update rspec-puppet to version 2.7.10. If using PDK, run `pdk bundle update rspec-puppet` or update your PDK package. If not using PDK, run `bundle update`.
      Show
      Testing modules using rspec-puppet versions earlier than 2.7.10 results in the error "undefined local variable or method `default_env' for Puppet::Util:Module". As a workaround, update rspec-puppet to version 2.7.10. If using PDK, run `pdk bundle update rspec-puppet` or update your PDK package. If not using PDK, run `bundle update`.
    • QA Risk Assessment:
      Needs Assessment

      Description

      Commit https://github.com/puppetlabs/puppet/commit/94df3c1a3992d89b2d7d5db8a70373c135bdd86b unintentionally removed the Puppet::Util.default_env method in 5.5.21 and 6.17.0, causing the following error when testing puppet modules using rspec-puppet:

       Failure/Error: require 'puppetlabs_spec_helper/module_spec_helper'
       NameError:
         undefined local variable or method `default_env' for Puppet::Util:Module
       # ./vendor/bundle/ruby/2.5.0/gems/rspec-puppet-2.7.8/lib/rspec-puppet/monkey_patches.rb:139:in `get_env'
       # ./vendor/bundle/ruby/2.5.0/gems/puppet-6.17.0/lib/puppet/node/environment.rb:501:in `extralibs'
       # ./vendor/bundle/ruby/2.5.0/gems/puppet-6.17.0/lib/puppet/node/environment.rb:76:in `initialize'
       # ./vendor/bundle/ruby/2.5.0/gems/puppet-6.17.0/lib/puppet/node/environment.rb:43:in `new'
       # ./vendor/bundle/ruby/2.5.0/gems/puppet-6.17.0/lib/puppet/node/environment.rb:43:in `create'
       # ./vendor/bundle/ruby/2.5.0/gems/puppet-6.17.0/lib/puppet.rb:240:in `base_context'
       # ./vendor/bundle/ruby/2.5.0/gems/puppet-6.17.0/lib/puppet/test/test_helper.rb:53:in `initialize'
       # ./vendor/bundle/ruby/2.5.0/gems/rspec-puppet-2.7.8/lib/rspec-puppet.rb:77:in `block in <top (required)>'
       # ./vendor/bundle/ruby/2.5.0/gems/rspec-puppet-2.7.8/lib/rspec-puppet.rb:34:in `<top (required)>'
       # ./vendor/bundle/ruby/2.5.0/gems/puppetlabs_spec_helper-2.15.0/lib/puppetlabs_spec_helper/module_spec_helper.rb:1:in `require'
       # ./vendor/bundle/ruby/2.5.0/gems/puppetlabs_spec_helper-2.15.0/lib/puppetlabs_spec_helper/module_spec_helper.rb:1:in `<top (required)>'
       # ./spec/spec_helper.rb:7:in `require'
       # ./spec/spec_helper.rb:7:in `<top (required)>'
      

      See also https://github.com/rodjek/rspec-puppet/issues/796.
       

        Attachments

          Activity

            People

            Assignee:
            josh Josh Cooper
            Reporter:
            josh Josh Cooper
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support