summaryrefslogtreecommitdiff
path: root/lib/chef/node
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2012-12-11 14:56:50 -0800
committerdanielsdeleo <dan@opscode.com>2012-12-11 14:56:50 -0800
commit5b343a73679fa33af97f928d02caa4ffa61d8789 (patch)
tree877a14151f210d606fc0c4434d3e862d0d5d08e1 /lib/chef/node
parent0cb9354243cd558457a89326f9be526722cd5ca5 (diff)
downloadchef-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.rb8
-rw-r--r--lib/chef/node/immutable_collections.rb4
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