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

Diplomat::Acl.info(uuid) raise if acl does not exist #71

Closed
kamaradclimber opened this issue Feb 5, 2016 · 0 comments
Closed

Diplomat::Acl.info(uuid) raise if acl does not exist #71

kamaradclimber opened this issue Feb 5, 2016 · 0 comments

Comments

@kamaradclimber
Copy link
Contributor

When calling Diplomat::Acl.info(a_uuid), the method raise an exception if the acl does not exist.
The expected output is to return nil instead.

With consul 0.5.2:

JSON::ParserError: 757: unexpected token at 'null'
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/json-1.8.3/lib/json/common.rb:155:in parse' from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/json-1.8.3/lib/json/common.rb:155:inparse'
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/diplomat-0.15.0/lib/diplomat/rest_client.rb:76:in parse_body' from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/diplomat-0.15.0/lib/diplomat/acl.rb:30:ininfo'
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/diplomat-0.15.0/lib/diplomat/rest_client.rb:46:in method_missing' from (irb):9 from /opt/chef/embedded/bin/irb:11:in

'

In this case, the body is the string "null" instead of being empty/nil.

kamaradclimber added a commit to criteo-forks/diplomat that referenced this issue Feb 5, 2016
According to https://www.consul.io/docs/agent/http/acl.html, when the
acl does not exist, return value is "null" instead of nothing.

Fixes WeAreFarmGeek#71
kamaradclimber added a commit to criteo-forks/diplomat that referenced this issue Apr 13, 2016
According to https://www.consul.io/docs/agent/http/acl.html, when the
acl does not exist, return value is "null" instead of nothing.

Fixes WeAreFarmGeek#71
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

No branches or pull requests

1 participant