def include_attribute(*fully_qualified_attribute_short_filenames)
if self.kind_of?(Chef::Node)
node = self
else
node = @node
end
fully_qualified_attribute_short_filenames.flatten.each do |fully_qualified_attribute_short_filename|
if node.run_state[:seen_attributes].has_key?(fully_qualified_attribute_short_filename)
Chef::Log.debug("I am not loading attribute file #{fully_qualified_attribute_short_filename}, because I have already seen it.")
next
end
Chef::Log.debug("Loading Attribute #{fully_qualified_attribute_short_filename}")
node.run_state[:seen_attributes][fully_qualified_attribute_short_filename] = true
if amatch = fully_qualified_attribute_short_filename.match(/(.+?)::(.+)/)
cookbook_name = amatch[1].to_sym
node.load_attribute_by_short_filename(amatch[2], cookbook_name)
else
cookbook_name = fully_qualified_attribute_short_filename.to_sym
node.load_attribute_by_short_filename("default", cookbook_name)
end
end
true
end