summaryrefslogtreecommitdiff
path: root/lib/chef/api_client_v1.rb
diff options
context:
space:
mode:
authortylercloke <tylercloke@gmail.com>2015-07-02 13:07:03 -0700
committertylercloke <tylercloke@gmail.com>2015-07-06 14:36:03 -0700
commit7950b19244fe948619cb0662be5a0044fffe0436 (patch)
treeddd075e5400d08689cf46e0f550ce7957dee3590 /lib/chef/api_client_v1.rb
parent89c7984a86778c23d23e2380824af6f843d39c87 (diff)
downloadchef-7950b19244fe948619cb0662be5a0044fffe0436.tar.gz
Fix automated object generation from HTTP layer in ApiClient.
Diffstat (limited to 'lib/chef/api_client_v1.rb')
-rw-r--r--lib/chef/api_client_v1.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/chef/api_client_v1.rb b/lib/chef/api_client_v1.rb
index 25c40df7f0..ac8918184d 100644
--- a/lib/chef/api_client_v1.rb
+++ b/lib/chef/api_client_v1.rb
@@ -26,6 +26,7 @@ require 'chef/search/query'
require 'chef/exceptions'
require 'chef/mixin/api_version_request_handling'
require 'chef/server_api'
+require 'chef/api_client'
# COMPATIBILITY NOTE
#
@@ -214,6 +215,10 @@ class Chef
response = http_api.get("clients/#{name}")
if response.kind_of?(Chef::ApiClientV1)
response
+ # stupid automated object generation.
+ # just give me the json :(
+ elsif response.kind_of?(Chef::ApiClient)
+ json_create(response.to_json)
else
json_create(response)
end