# File lib/chef/node/attribute.rb, line 319 def []=(key, value) # If we don't have one, then we'll pretend we're normal @set_type ||= :normal if set_unless_value_present if get_value(set_type_hash, key) != nil Chef::Log.debug("Not setting #{@current_nesting_level.join("/")}/#{key} to #{value.inspect} because it has a #{@set_type} value already") return false end end # If we have been read, and the key we are writing is the same # as our parent, we have most like been ||='ed. So we need to # just rewind a bit. # # In practice, these objects are single use - this is just # supporting one more single-use style. @current_nesting_level.pop if @has_been_read && @current_nesting_level.last == key set_value(set_type_hash, key, value) value end