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

Remove puppet error when ACLs cannot be retrieved #285

Merged
merged 2 commits into from
Oct 5, 2016

Conversation

thejandroman
Copy link
Contributor

Currently if consul does not come up or there is some issue electing a
leader, the consul_acl will throw a hard puppet error. This causes the
puppet run to immediately fail. This commit changes that puppet error to
a warning. The unavailability of the consul API should not cause a
puppet failure.

Currently if consul does not come up or there is some issue electing a
leader, the consul_acl will throw a hard puppet error. This causes the
puppet run to immediately fail. This commit changes that puppet error to
a warning. The unavailability of the consul API should not cause a
puppet failure.
@@ -57,7 +57,9 @@ def self.list_resources(acl_api_token, port, hostname, protocol, tries)
if res.code == '200'
acls = JSON.parse(res.body)
else
raise(Puppet::Error,"Cannot retrieve ACLs: invalid return code #{res.code} uri: #{path} body: #{req.body}")
Puppet.warning("Cannot retrieve ACLs: invalid return code #{res.code} uri: #{path} body: #{req.body}")
$stderr.puts "Cannot retrieve ACLs: invalid return code #{res.code} uri: #{path} body: #{req.body}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need both the puppet warning and stderr?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. That must have snuck in during testing. I'll remove the stderr.

@solarkennedy
Copy link
Contributor

I don't know whats up with those test failure, let me look at those a bit and compare to master.

@solarkennedy solarkennedy merged commit 45ca5cf into voxpupuli:master Oct 5, 2016
spuder pushed a commit to spuder/puppet-consul that referenced this pull request Feb 25, 2020
Remove puppet error when ACLs cannot be retrieved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants