Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON.parse() can't convert RestClient::Response into String #6

Open
ampledata opened this issue Jun 21, 2011 · 0 comments
Open

JSON.parse() can't convert RestClient::Response into String #6

ampledata opened this issue Jun 21, 2011 · 0 comments

Comments

@ampledata
Copy link

For some reason Chef's dynect cookbook returns a RestClient::Response when get()'ing resources from Dynect. This can be seen by running this recipe: https://github.com/opscode/cookbooks/blob/master/dynect/recipes/ec2.rb Which will fail with a fatal error:
[Tue, 21 Jun 2011 00:17:19 +0000] FATAL: TypeError: dynect_rr[i-8bd180e5] (dynect::ec2 line 23) had an error: can't convert RestClient::Response into String

However, the same code in ruby seems to work OK:
require 'rubygems' require 'dynect_rest' res = 'i-8bd180e5.example.com' dyn = DynectRest.new("example", "me", "xxx", "example.com") DynectRest::Resource.new(dyn, 'CNAMERecord', 'example.com').get(res)

I'm not entirely sure this is an error with the cookbook, so I'm opening an issue here for the dynect_rest library. The fix is to send the response_body to JSON.parse() with .to_s. Patch inbound.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant