diff options
author | danielsdeleo <dan@opscode.com> | 2012-12-11 14:56:50 -0800 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2012-12-11 14:56:50 -0800 |
commit | 5b343a73679fa33af97f928d02caa4ffa61d8789 (patch) | |
tree | 877a14151f210d606fc0c4434d3e862d0d5d08e1 /lib/chef/node | |
parent | 0cb9354243cd558457a89326f9be526722cd5ca5 (diff) | |
download | chef-5b343a73679fa33af97f928d02caa4ffa61d8789.tar.gz |
[CHEF-3680] don't invalidate computed attributes on dup
Diffstat (limited to 'lib/chef/node')
-rw-r--r-- | lib/chef/node/attribute_collections.rb | 8 | ||||
-rw-r--r-- | lib/chef/node/immutable_collections.rb | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/chef/node/attribute_collections.rb b/lib/chef/node/attribute_collections.rb index 5f4728b400..dcbb4601bd 100644 --- a/lib/chef/node/attribute_collections.rb +++ b/lib/chef/node/attribute_collections.rb @@ -76,6 +76,10 @@ class Chef super(data) end + def dup + Array.new(map {|e| e.dup}) + end + end # == VividMash @@ -185,6 +189,10 @@ class Chef end end + def dup + Mash.new(self) + end + end end diff --git a/lib/chef/node/immutable_collections.rb b/lib/chef/node/immutable_collections.rb index 25a653ef74..857365d8d6 100644 --- a/lib/chef/node/immutable_collections.rb +++ b/lib/chef/node/immutable_collections.rb @@ -195,8 +195,9 @@ class Chef end def dup - Array.new(self) + Array.new(map {|e| e.dup }) end + end # == ImmutableMash @@ -381,6 +382,7 @@ class Chef def dup Mash.new(self) end + end end |