diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-02-07 20:28:35 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-02-21 14:32:17 -0800 |
commit | ebdf5a37fa14fd3d9d039b06df5cfc10ab6d8c91 (patch) | |
tree | 393075edc8e304de3b67dbb777b476e3b153fea3 | |
parent | da6382072c9d926f1611b0e94dd37dbe87ab6896 (diff) | |
download | chef-ebdf5a37fa14fd3d9d039b06df5cfc10ab6d8c91.tar.gz |
fix another perf bug
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r-- | lib/chef/node/attribute.rb | 2 | ||||
-rw-r--r-- | lib/chef/node/attribute_collections.rb | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/chef/node/attribute.rb b/lib/chef/node/attribute.rb index dd6f645dfa..4ffc25c7af 100644 --- a/lib/chef/node/attribute.rb +++ b/lib/chef/node/attribute.rb @@ -229,10 +229,12 @@ class Chef end def reset + #puts "TOTAL RESET" @deep_merge_cache = nil end def reset_cache(*path) + #puts "PATH: #{path}" if path.empty? reset else diff --git a/lib/chef/node/attribute_collections.rb b/lib/chef/node/attribute_collections.rb index 652820826d..d74aba9f51 100644 --- a/lib/chef/node/attribute_collections.rb +++ b/lib/chef/node/attribute_collections.rb @@ -76,7 +76,7 @@ class Chef def initialize(data = []) super(data) - map! { |e| convert_value(e) } + map! { |e| convert_value(e, __path__) } end # For elements like Fixnums, true, nil... @@ -92,7 +92,7 @@ class Chef private - def convert_value(value) + def convert_value(value, path = nil) value.ensure_generated_cache! if value.respond_to?(:ensure_generated_cache!) case value when VividMash @@ -100,9 +100,9 @@ class Chef when AttrArray value when Hash - VividMash.new(value, __root__, __node__, __precedence__) + VividMash.new(value, __root__, __node__, __precedence__, path) when Array - AttrArray.new(value, __root__, __node__, __precedence__) + AttrArray.new(value, __root__, __node__, __precedence__, path) else value end |