Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip 403 Forbidden exception when getting node acl #519

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,16 @@ def create_chef_objects(action_handler, machine, private_key, public_key)
def grant_client_node_permissions(action_handler, chef_server, machine, perms, private_key)
node_name = machine.name
api = Cheffish.chef_server_api(chef_server)
node_perms = api.get("/nodes/#{node_name}/_acl")
begin
node_perms = api.get("/nodes/#{node_name}/_acl")
rescue Net::HTTPServerException => e
if e.response.code == "403"
# Skip the 403 Forbidden exception
# This allows possibility that 2nd machine convergence could be done by a user that does not have grant permission on node object
return if convergence_options[:skip_node_acl_forbidden_excp]
end
raise
end

begin
perms.each do |p|
Expand Down