summaryrefslogtreecommitdiff
path: root/lib/chef_zero/endpoints/actor_endpoint.rb
diff options
context:
space:
mode:
authorJohn Keiser <jkeiser@opscode.com>2014-04-14 15:18:36 -0700
committerJohn Keiser <jkeiser@opscode.com>2014-04-14 15:18:36 -0700
commitd66376d5a813fe11a6272ce890fd36bfd32ca0db (patch)
treeb53100b14eaafa03f589556b833b80577f94158e /lib/chef_zero/endpoints/actor_endpoint.rb
parentd74e5b8abe16abf98ece81583b2f4abc5a8e7fae (diff)
downloadchef-zero-d66376d5a813fe11a6272ce890fd36bfd32ca0db.tar.gz
Fixes against latest pedant
Diffstat (limited to 'lib/chef_zero/endpoints/actor_endpoint.rb')
-rw-r--r--lib/chef_zero/endpoints/actor_endpoint.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/chef_zero/endpoints/actor_endpoint.rb b/lib/chef_zero/endpoints/actor_endpoint.rb
index 467422b..352a682 100644
--- a/lib/chef_zero/endpoints/actor_endpoint.rb
+++ b/lib/chef_zero/endpoints/actor_endpoint.rb
@@ -37,17 +37,12 @@ module ChefZero
result = super(request)
# Inject private_key into response, delete public_key/password if applicable
- if result[0] == 200
+ if result[0] == 200 || result[0] == 201
response = JSON.parse(result[2], :create_additions => false)
response['private_key'] = private_key if private_key
response.delete('public_key') if !updating_public_key && request.rest_path[0] == 'users'
response.delete('password')
- # For PUT /clients, a rename returns 201.
- if request_body['name'] && request.rest_path[1] != request_body['name']
- json_response(201, response)
- else
- json_response(200, response)
- end
+ json_response(result[0], response)
else
result
end
@@ -65,4 +60,3 @@ module ChefZero
end
end
end
-