diff options
author | Adam Jacob <adam@opscode.com> | 2012-12-12 15:52:06 -0800 |
---|---|---|
committer | Adam Jacob <adam@opscode.com> | 2012-12-12 16:44:08 -0800 |
commit | a19d39a2e7fbeb52ad8b9f713f015781536d5e23 (patch) | |
tree | 6b7817556525cadd3a2b9733500cea46f9cda44b /lib/chef/node/attribute.rb | |
parent | e109d6de95ed1e6291e23dab802e8879e4f4d947 (diff) | |
download | chef-a19d39a2e7fbeb52ad8b9f713f015781536d5e23.tar.gz |
CHEF-3688 remove stale attribute read protection
This commit removes stale attribute read protection, as it does more
harm than good. Includes removal of passing "root" around to
immutablize.
Diffstat (limited to 'lib/chef/node/attribute.rb')
-rw-r--r-- | lib/chef/node/attribute.rb | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/lib/chef/node/attribute.rb b/lib/chef/node/attribute.rb index 6b7f6792ff..9da96886a5 100644 --- a/lib/chef/node/attribute.rb +++ b/lib/chef/node/attribute.rb @@ -66,8 +66,6 @@ class Chef :@force_override ] - attr_reader :serial_number - [:all?, :any?, :assoc, @@ -190,7 +188,6 @@ class Chef attr_reader :automatic def initialize(normal, default, override, automatic) - @serial_number = 0 @set_unless_present = false @default = VividMash.new(self, default) @@ -218,11 +215,8 @@ class Chef end # Clears merged_attributes, which will cause it to be recomputed on the - # next access. Additionally, increments the serial_number, which is used - # by the implementation of merged_attributes to detect reads from a - # stale merged attribute collection. + # next access. def reset_cache - @serial_number += 1 @merged_attributes = nil @combined_default = nil @combined_override = nil @@ -294,7 +288,7 @@ class Chef component_value = instance_variable_get(component_ivar) Chef::Mixin::DeepMerge.merge(merged, component_value) end - immutablize(self, resolved_attrs) + immutablize(resolved_attrs) end end @@ -304,7 +298,7 @@ class Chef component_value = instance_variable_get(component_ivar) Chef::Mixin::DeepMerge.merge(merged, component_value) end - immutablize(self, resolved_attrs) + immutablize(resolved_attrs) end end @@ -314,7 +308,7 @@ class Chef component_value = instance_variable_get(component_ivar) Chef::Mixin::DeepMerge.merge(merged, component_value) end - immutablize(self, resolved_attrs) + immutablize(resolved_attrs) end end @@ -364,10 +358,6 @@ class Chef @set_unless_present end - def stale_subtree?(serial_number) - serial_number != @serial_number - end - end end |