diff options
author | John Keiser <john@johnkeiser.com> | 2015-11-13 16:43:28 -0800 |
---|---|---|
committer | John Keiser <john@johnkeiser.com> | 2015-11-18 10:53:43 -0800 |
commit | 1f8dde87ca01348fe84cf6c3e3c35198e8ac51dd (patch) | |
tree | f3ff220708f0ec8b46f472ada1753af7d87609d2 /lib | |
parent | 8364aeb261de4ecabbfb0c98d70945a896f0a0d9 (diff) | |
download | chef-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.rb | 15 |
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 |