diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2015-09-02 18:01:09 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-09-14 15:56:00 -0700 |
commit | 72cb4af6451f67791469456899df5bd09db94d7b (patch) | |
tree | 1ccdbe25220634512e9eef58e43c50a9a4ff4907 /lib/chef/resource.rb | |
parent | a300e22d486df119b5588ca28d13f21e5cdb7353 (diff) | |
download | chef-72cb4af6451f67791469456899df5bd09db94d7b.tar.gz |
Remove the warning about hashes and arrays as default values
- This isn't a bug to declare an LWRP default hash or array, its a
bug to use the hash or array in such a way as to mutate it. A lot
of LWRP authors will get this triggered on their code when none of
their users are actually triggering the bug.
- It would be better handled by freezing default values in Chef 13.
- We could also just not try to solve this problem in code and treat
it fundamentally as a documentation/education problem.
Diffstat (limited to 'lib/chef/resource.rb')
-rw-r--r-- | lib/chef/resource.rb | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb index ee75dec3b9..aec78b4f6d 100644 --- a/lib/chef/resource.rb +++ b/lib/chef/resource.rb @@ -808,10 +808,6 @@ class Chef property = property_type(**options) end - if !options[:default].frozen? && (options[:default].is_a?(Array) || options[:default].is_a?(Hash)) - Chef.log_deprecation("Property #{self}.#{name} has an array or hash default (#{options[:default]}). This means that if one resource modifies or appends to it, all other resources of the same type will also see the changes. Either freeze the constant with `.freeze` to prevent appending, or use lazy { #{options[:default].inspect} }.") - end - local_properties = properties(false) local_properties[name] = property |