Closed ryndaniels closed 6 years ago
Hi,
Thanks for the report. My team has switched to Chef 12 but I think supporting Chef 11 is reasonable for now! A PR would be great, I'll review and merge it as soon as I can
Oops, I just realised I'm only running the tests on Travis using Chef 12. I did that in e6d8c4bbd157ea1e6bf37970564c96c2f366d5ab
I'm still open to make it work again on Chef 11 since there's demand
@gregkare cool, I'm thinking a simple check for Chef version should suffice, and I can add a Chef 11 version in travis if that's ok. Are there unit tests or anything that you use beyond the rake spec that I should use to test this before opening a PR?
@kdaniels Yeah, version checking is alright. Sadly not everything is covered by the specs, but all specs are run by the rake take and I don't have more tests than that for now
@kdaniels By the way did you try knife-inspect 0.13.0 on Chef 11? It should be still working unless I broke something
@gregkare yup, 0.13 and earlier still work, which would certainly be a workaround for us. Still happy to submit a fix if you think it would be worth it as a fix, let me know!
Hi, I completely forgot to respond, sorry about that! I'd be interested in a fix for Chef 11, I would then release 0.15.0 bringing back Chef 11 support
I forgot to close this one
I'm getting an exception running knife environment expect with chef 11.18. I believe it is related to this commit which changes json_create to from_hash, but while json_create is deprecated in more recent versions of chef, from_hash does not exist in environment.rb in the chef 11.18 code.
The readme indicates that this should be compatible with chef 11 but given this, I don't believe that to be the case. Do you have plans to test this on chef 11 in the future? If so I'd be happy to work on a fix for this issue, but if not, updating the readme to state that this isn't being tested on/developed for earlier versions of chef would be helpful. Thanks!
Verbose output of the issue I'm seeing:
knife environment inspect production -VV DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_request DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_request DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_request DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_request DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_request DEBUG: Signing the request as kdaniels DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_request DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_request DEBUG: Initiating GET to <CHEFSERVER>/environments/production (output cut) DEBUG: ---- End HTTP Request Header Data ---- DEBUG: ---- HTTP Status and Header Data: ---- DEBUG: HTTP 1.1 200 OK DEBUG: server: openresty/1.7.10.1 DEBUG: date: Thu, 16 Jun 2016 21:27:47 GMT DEBUG: content-type: application/json DEBUG: transfer-encoding: chunked DEBUG: connection: close DEBUG: x-ops-server-api-version: {"min_version":"0","max_version":"1","request_version":"0","response_version":"0"} DEBUG: x-ops-api-info: flavor=cs;version=12.0.0;oc_erchef=12.1.1 DEBUG: content-encoding: gzip DEBUG: ---- End HTTP Status/Header Data ---- DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_response DEBUG: HTTP server did not include a Content-Length header in response, cannot identify truncated downloads. DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_response DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_response DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_response DEBUG: decompressing gzip response DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_response DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_response DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_response /usr/lib64/ruby/gems/1.9.1/gems/knife-inspect-0.14.0/lib/health_inspector/checklists/base.rb:144:in 'load_ruby_or_json_from_local': undefined method 'from_hash' for Chef::Environment:Class (NoMethodError) from /usr/lib64/ruby/gems/1.9.1/gems/knife-inspect-0.14.0/lib/health_inspector/checklists/environments.rb:43:in 'load_item_from_local' from /usr/lib64/ruby/gems/1.9.1/gems/knife-inspect-0.14.0/lib/health_inspector/checklists/environments.rb:22:in 'load_item' from /usr/lib64/ruby/gems/1.9.1/gems/knife-inspect-0.14.0/lib/health_inspector/runner.rb:22:in 'run' from /usr/lib64/ruby/gems/1.9.1/gems/chef-11.18.12/lib/chef/knife.rb:493:in 'run_with_pretty_exceptions' from /usr/lib64/ruby/gems/1.9.1/gems/chef-11.18.12/lib/chef/knife.rb:174:in 'run' from /usr/lib64/ruby/gems/1.9.1/gems/chef-11.18.12/lib/chef/application/knife.rb:139:in 'run' from /usr/lib64/ruby/gems/1.9.1/gems/chef-11.18.12/bin/knife:25:in '<top (required)>' from /usr/bin/knife:23:in 'load' from /usr/bin/knife:23:in '<main>'