diff --git a/lib/cheffish/chef_provider_base.rb b/lib/cheffish/chef_provider_base.rb index 8f46a8e..877e991 100644 --- a/lib/cheffish/chef_provider_base.rb +++ b/lib/cheffish/chef_provider_base.rb @@ -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