summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Casey <james@opscode.com>2014-02-18 13:29:08 -0800
committerJames Casey <james@opscode.com>2014-02-18 13:59:03 -0800
commit075469c3edc95581090f857aa35ee0074d7e4a61 (patch)
tree92102bd09ce9744970751a511290dee2d524fd63
parentdc47d5ab78ca3687afb00a0182f458db3f5131de (diff)
downloadchef-075469c3edc95581090f857aa35ee0074d7e4a61.tar.gz
Delegate ApiClient.load to ApiClient.json_create
This means the validator/public_key/admin fields of the ApiClient object now get set properly
-rw-r--r--lib/chef/api_client.rb4
-rw-r--r--spec/unit/api_client_spec.rb2
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/chef/api_client.rb b/lib/chef/api_client.rb
index 66cbd3f30e..7b7fd99ff7 100644
--- a/lib/chef/api_client.rb
+++ b/lib/chef/api_client.rb
@@ -162,9 +162,7 @@ class Chef
if response.kind_of?(Chef::ApiClient)
response
else
- client = Chef::ApiClient.new
- client.name(response['clientname'])
- client
+ json_create(response)
end
end
diff --git a/spec/unit/api_client_spec.rb b/spec/unit/api_client_spec.rb
index 22211d685f..8657fa59a8 100644
--- a/spec/unit/api_client_spec.rb
+++ b/spec/unit/api_client_spec.rb
@@ -164,7 +164,7 @@ describe Chef::ApiClient do
end
- describe "when loading from JSON", :focus => true do
+ describe "when loading from JSON" do
before do
end