def []=(key, value)
if @set_type.nil?
@set_type = :normal
warning="Setting attributes without specifying a precedence is deprecated and will be\nremoved in Chef 11.0. To set attributes at normal precedence, change code like:\n`node[\"key\"] = \"value\"` # Not this\nto:\n`node.set[\"key\"] = \"value\"` # This\n\nCalled from:\n"
warning_with_line_nrs = caller[0...3].inject(warning) do |msg, source_line|
msg << " #{source_line}\n"
end
Chef::Log.warn(warning_with_line_nrs) if Chef::Config[:chef11_deprecation_warnings]
end
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
@current_nesting_level.pop if @has_been_read && @current_nesting_level.last == key
set_value(set_type_hash, key, value)
value
end