Skip to content

Commit b06a0de

Browse files
committed
(PUP-12077) Move stringify_rich into the base_context
1 parent 3ee2564 commit b06a0de

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/puppet.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,11 @@ def self.base_context(settings)
237237
:ssl_context => proc { Puppet.runtime[:http].default_ssl_context },
238238
:http_session => proc { Puppet.runtime[:http].create_session },
239239
:plugins => proc { Puppet::Plugins::Configuration.load_plugins },
240-
:rich_data => Puppet[:rich_data]
240+
:rich_data => Puppet[:rich_data],
241+
# `stringify_rich` controls whether `rich_data` is stringified into a lossy format
242+
# instead of a lossless format. Catalogs should not be stringified, though to_yaml
243+
# and the resource application have uses for a lossy, user friendly format.
244+
:stringify_rich => false
241245
}
242246
end
243247

lib/puppet/resource.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def to_data_hash
112112
# To get stringified parameter values the flag :stringify_rich can be set
113113
# in the puppet context.
114114
#
115-
stringify = Puppet.lookup(:stringify_rich) { false }
115+
stringify = Puppet.lookup(:stringify_rich)
116116
converter = stringify ? Puppet::Pops::Serialization::ToStringifiedConverter.new : nil
117117

118118
params = {}

0 commit comments

Comments
 (0)