diff options
author | John Keiser <john@johnkeiser.com> | 2015-09-23 12:48:31 -0700 |
---|---|---|
committer | John Keiser <john@johnkeiser.com> | 2015-09-23 14:08:52 -0700 |
commit | efe6286540a56960e109dcc65db63cc7461c1753 (patch) | |
tree | dad6872cc3c4865fb2e4cf47c08fdfa772c025d0 /lib/chef/chef_fs/file_system | |
parent | 2ded4c34fdb2bf8b1f2caa8213cacd022db7084a (diff) | |
download | chef-efe6286540a56960e109dcc65db63cc7461c1753.tar.gz |
Re-upgrade chef-zero to latestjk/latest-chef-zero
Diffstat (limited to 'lib/chef/chef_fs/file_system')
-rw-r--r-- | lib/chef/chef_fs/file_system/chef_server_root_dir.rb | 3 | ||||
-rw-r--r-- | lib/chef/chef_fs/file_system/organization_members_entry.rb | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/chef/chef_fs/file_system/chef_server_root_dir.rb b/lib/chef/chef_fs/file_system/chef_server_root_dir.rb index e3ffd644ad..a243e0ae6b 100644 --- a/lib/chef/chef_fs/file_system/chef_server_root_dir.rb +++ b/lib/chef/chef_fs/file_system/chef_server_root_dir.rb @@ -120,7 +120,8 @@ class Chef if File.dirname(path) == '/organizations' File.basename(path) else - nil + # In Chef 12, everything is in an org. + 'chef' end end end diff --git a/lib/chef/chef_fs/file_system/organization_members_entry.rb b/lib/chef/chef_fs/file_system/organization_members_entry.rb index 94393b341f..40042a9cbc 100644 --- a/lib/chef/chef_fs/file_system/organization_members_entry.rb +++ b/lib/chef/chef_fs/file_system/organization_members_entry.rb @@ -39,9 +39,9 @@ class Chef members = minimize_value(_read_json) (desired_members - members).each do |member| begin - rest.post(File.join(api_path, member), {}) + rest.post(api_path, 'username' => member) rescue Net::HTTPServerException => e - if e.response.code == '404' + if %w(404 405).include?(e.response.code) raise "Chef server at #{api_path} does not allow you to directly add members. Please either upgrade your Chef server or move the users you want into invitations.json instead of members.json." else raise |