summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2015-11-13 16:43:28 -0800
committerJohn Keiser <john@johnkeiser.com>2015-11-18 10:53:43 -0800
commit1f8dde87ca01348fe84cf6c3e3c35198e8ac51dd (patch)
treef3ff220708f0ec8b46f472ada1753af7d87609d2 /lib
parent8364aeb261de4ecabbfb0c98d70945a896f0a0d9 (diff)
downloadchef-1f8dde87ca01348fe84cf6c3e3c35198e8ac51dd.tar.gz
Fix /acls/environments and /acls/environments/x.json
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/chef_fs/chef_fs_data_store.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/chef/chef_fs/chef_fs_data_store.rb b/lib/chef/chef_fs/chef_fs_data_store.rb
index 00929180f9..c1c43db126 100644
--- a/lib/chef/chef_fs/chef_fs_data_store.rb
+++ b/lib/chef/chef_fs/chef_fs_data_store.rb
@@ -532,9 +532,22 @@ class Chef
end
end
end
+
+ elsif path[0] == 'acls'
+ # /acls/containers|nodes|.../x.json
+ # /acls/organization.json
+ if path.length == 3 || path == [ 'acls', 'organization' ]
+ path = path.dup
+ path[-1] = "#{path[-1]}.json"
+ end
+
+ # /acls/containers|nodes|... do NOT drop into the next elsif, and do
+ # not get .json appended
+
+ # /nodes|clients|.../x.json
elsif path.length == 2
path = path.dup
- path[1] = "#{path[1]}.json"
+ path[-1] = "#{path[-1]}.json"
end
path
end