summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Keiser <jkeiser@opscode.com>2014-08-26 12:16:21 -0700
committerJohn Keiser <jkeiser@opscode.com>2014-08-26 12:16:21 -0700
commite40fcd441e6e3869a6f4c6a802603085c471f740 (patch)
tree21b1afc4498bfc809a1355a75ad70c6964623a39
parentdefd2113e3b9cab2483cc6145280b434b9940880 (diff)
downloadchef-zero-e40fcd441e6e3869a6f4c6a802603085c471f740.tar.gz
Fix organizations to honor full_name
-rw-r--r--lib/chef_zero/endpoints/organizations_endpoint.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef_zero/endpoints/organizations_endpoint.rb b/lib/chef_zero/endpoints/organizations_endpoint.rb
index 835faf9..3a34fe4 100644
--- a/lib/chef_zero/endpoints/organizations_endpoint.rb
+++ b/lib/chef_zero/endpoints/organizations_endpoint.rb
@@ -15,8 +15,8 @@ module ChefZero
end
def post(request)
- contents = request.body
- name = JSON.parse(contents, :create_additions => false)['name']
+ contents = JSON.parse(request.body, :create_additions => false)
+ name = contents['name']
if name.nil?
error(400, "Must specify 'name' in JSON")
elsif exists_data_dir?(request, request.rest_path + [ name ])
@@ -27,7 +27,7 @@ module ChefZero
org = {
"guid" => UUIDTools::UUID.random_create.to_s.gsub('-', ''),
"assigned_at" => Time.now.to_s
- }
+ }.merge(contents)
org_path = request.rest_path + [ name ]
set_data(request, org_path + [ 'org' ], JSON.pretty_generate(org))