Method: ChefAPI::Resource::Base#diff
- Defined in:
- lib/chef-api/resources/base.rb
#diff ⇒ Hash
Note:
This is a VERY expensive operation - use it sparringly!
Calculate a differential of the attributes on the local resource with it’s remote Chef Server counterpart.
864 865 866 867 868 869 870 871 872 873 874 875 |
# File 'lib/chef-api/resources/base.rb', line 864 def diff diff = {} remote = self.class.fetch(id, _prefix) || self.class.new({}, _prefix) remote._attributes.each do |key, value| unless _attributes[key] == value diff[key] = { local: _attributes[key], remote: value } end end diff end |