summaryrefslogtreecommitdiff
path: root/chef/lib/chef/node
diff options
context:
space:
mode:
authorAdam Jacob <adam@opscode.com>2009-08-13 18:46:56 -0700
committerAJ Christensen <aj@opscode.com>2009-09-04 13:23:47 +1200
commit3ead7a2b936cca291d3a91e1d42effce09969dc4 (patch)
tree4aff91563734a3bbbad2e8a7f85ccf609bb004cf /chef/lib/chef/node
parentca6dd91b34e876024b51f218f0e43601c467a94f (diff)
downloadchef-3ead7a2b936cca291d3a91e1d42effce09969dc4.tar.gz
Final fix for chef-492 - makes the context for the template provider always be distinct from the data we feed it in the variables method, to make sure we don't inadvertantly leak the node object into other persistent data.
Diffstat (limited to 'chef/lib/chef/node')
-rw-r--r--chef/lib/chef/node/attribute.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/chef/lib/chef/node/attribute.rb b/chef/lib/chef/node/attribute.rb
index e51ad29c22..ad8a493769 100644
--- a/chef/lib/chef/node/attribute.rb
+++ b/chef/lib/chef/node/attribute.rb
@@ -398,6 +398,14 @@ class Chef
end
end
+ def to_hash
+ result = determine_value(current_override, current_attribute, current_default)
+ if result.class == Hash
+ result
+ else
+ result.to_hash
+ end
+ end
end
end