diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-02-07 20:28:35 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-02-07 20:28:35 -0800 |
commit | 8fcb1e519ccdbf9ccd62f76ac966d0b89f661ff8 (patch) | |
tree | e38ac6284e61f3f07bce9eb06df267e57c60195a | |
parent | f4e8476902af44c342c9b162ae8faba7142ce3b6 (diff) | |
download | chef-8fcb1e519ccdbf9ccd62f76ac966d0b89f661ff8.tar.gz |
fix another perf bug
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r-- | lib/chef/node/attribute.rb | 4 | ||||
-rw-r--r-- | lib/chef/node/attribute_collections.rb | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/chef/node/attribute.rb b/lib/chef/node/attribute.rb index 6c686e9583..1bdc35d742 100644 --- a/lib/chef/node/attribute.rb +++ b/lib/chef/node/attribute.rb @@ -1,7 +1,7 @@ #-- # Author:: Adam Jacob (<adam@chef.io>) # Author:: AJ Christensen (<aj@chef.io>) -# Copyright:: Copyright 2008-2017, Chef Software Inc. +# Copyright:: Copyright 2008-2018, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -235,10 +235,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 4e27f82aae..a5193de322 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 |