summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2015-06-30 13:58:09 -0600
committerJohn Keiser <john@johnkeiser.com>2015-07-03 13:10:23 -0600
commit88e90f48952d0776b2d2b5f641c3d1b08c1376bb (patch)
treef9b3027cd6ce01a38e937805d642a58ce16d8dd9 /lib/chef
parentd08645c68967630030bc70934899e092744487d1 (diff)
downloadchef-88e90f48952d0776b2d2b5f641c3d1b08c1376bb.tar.gz
Only stick non-frozen values to the resource
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/property.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/chef/property.rb b/lib/chef/property.rb
index 17554c5661..2eeec87f75 100644
--- a/lib/chef/property.rb
+++ b/lib/chef/property.rb
@@ -279,12 +279,20 @@ class Chef
value = default
if value.is_a?(DelayedEvaluator)
value = exec_in_resource(resource, value)
- value = coerce(resource, value)
- # We don't validate defaults
+ end
+
+ value = coerce(resource, value)
+
+ # We don't validate defaults
+
+ # If the value is mutable (non-frozen), we set it on the instance
+ # so that people can mutate it. (All constant default values are
+ # frozen.)
+ if !value.frozen?
set_value(resource, value)
- else
- value = coerce(resource, value)
end
+
+ value
end
end
end