summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/node/attribute.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/chef/node/attribute.rb b/lib/chef/node/attribute.rb
index 17d16f64c2..4574572cfc 100644
--- a/lib/chef/node/attribute.rb
+++ b/lib/chef/node/attribute.rb
@@ -192,6 +192,8 @@ class Chef
@__node__ = node
node.attributes = self
+ @disable_cache_reset = false
+
defer_cache_resetting do
@default = VividMash.new({}, self, node, :default)
@env_default = VividMash.new({}, self, node, :env_default)
@@ -251,10 +253,11 @@ class Chef
# avoid doing cache clearing work for an entire block of code, then nuke the entire cache
# @api private
def defer_cache_resetting
+ saved = @disable_cache_reset
@disable_cache_reset = true
yield
- @disable_cache_reset = false
- reset
+ @disable_cache_reset = saved
+ reset_cache
end
# @api private