Skip to content

Commit

Permalink
Fix issues with puppet gem removal of default_env
Browse files Browse the repository at this point in the history
Since this is now changed to `DEFAULT_ENV`, we now create the old
function alias to retain functionality.

Bug: #796
Upstream: https://github.com/puppetlabs/puppet/blob/94df3c1a3992d89b2d7d5db8a70373c135bdd86b/lib/puppet/util.rb
  • Loading branch information
sgnn7 authored and scotje committed Jul 15, 2020
1 parent 813c6f2 commit b6807eb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file. This
project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased
### Fixed
* Fix issues with puppet gem removal of `default_env` #796

## [2.7.8]

### Fixed
Expand Down
10 changes: 10 additions & 0 deletions lib/rspec-puppet/monkey_patches.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@ def find_manifests_in_modules(pattern, environment)
end

module Util
# Fix for removal of default_env function
# Bug: https://github.com/rodjek/rspec-puppet/issues/796
# Upstream: https://github.com/puppetlabs/puppet/commit/94df3c1a3992d89b2d7d5db8a70373c135bdd86b
if !respond_to?(:default_env)
def default_env()
DEFAULT_ENV
end
module_function :default_env
end

if respond_to?(:get_env)
alias :old_get_env :get_env
module_function :old_get_env
Expand Down

0 comments on commit b6807eb

Please sign in to comment.