Skip to content

Commit

Permalink
[puppetlabs#9470] Respect environment/settings in base context rich_d…
Browse files Browse the repository at this point in the history
…ata value
  • Loading branch information
justinstoller committed Sep 3, 2024
1 parent 7739378 commit 6d31b26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/puppet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def self.base_context(settings)
:ssl_context => proc { Puppet.runtime[:http].default_ssl_context },
:http_session => proc { Puppet.runtime[:http].create_session },
:plugins => proc { Puppet::Plugins::Configuration.load_plugins },
:rich_data => false
:rich_data => proc { Puppet.lookup(:current_environment).rich_data? }
}
end

Expand Down
6 changes: 6 additions & 0 deletions spec/unit/resource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,12 @@ def inject_and_set_defaults(resource, scope)
# Note: to_stringified_spec.rb has tests for all other data types
end

# Try something like
# include PuppetSpec::Compiler
# Puppet[:rich_data] = true|false
# resource (?) = evaluate('Deferred("func", ["a", "b", "c"])')
# resource.to_data_hash()

describe "when converting from json" do
before do
@data = {
Expand Down

0 comments on commit 6d31b26

Please sign in to comment.