Skip to content

Commit

Permalink
Allow node attributes to be used as input to new_json / augment_new_j…
Browse files Browse the repository at this point in the history
  • Loading branch information
jkeiser committed Feb 26, 2015
1 parent 39c070f commit e980fdb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/cheffish/chef_provider_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ def resource_to_json(resource)
json = resource.raw_json || {}
keys.each do |json_key, resource_key|
value = resource.send(resource_key)
# This takes care of Chef ImmutableMash and ImmutableArray
value = value.to_hash if value.is_a?(Hash)
value = value.to_a if value.is_a?(Array)
json[json_key] = value if value
end
json
Expand Down

0 comments on commit e980fdb

Please sign in to comment.