diff options
author | Noah Kantrowitz <noah@coderanger.net> | 2017-04-03 22:05:00 -0500 |
---|---|---|
committer | Noah Kantrowitz <noah@coderanger.net> | 2017-04-03 22:05:00 -0500 |
commit | b95a1bb1d167d31f56892baf7e424c146ebba0b4 (patch) | |
tree | 234ee809abbb538c5d9f9c920a126a25ded03d00 /lib/chef/property.rb | |
parent | 41fa5caa4a75abf71aaf435c77423adf2b3d0306 (diff) | |
download | chef-b95a1bb1d167d31f56892baf7e424c146ebba0b4.tar.gz |
Freeze the default value for properties unless it is a lazy.
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
Diffstat (limited to 'lib/chef/property.rb')
-rw-r--r-- | lib/chef/property.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/chef/property.rb b/lib/chef/property.rb index c6f72e15a7..ecc23b701c 100644 --- a/lib/chef/property.rb +++ b/lib/chef/property.rb @@ -110,6 +110,9 @@ class Chef raise ArgumentError, "Cannot specify both default and name_property/name_attribute together on property #{self}" end + # Freeze the default if it isn't a lazy value. + default.freeze unless default.is_a?(DelayedEvaluator) + # Validate the default early, so the user gets a good error message, and # cache it so we don't do it again if so begin |