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

passingonly needs to be a boolean for watch type #97

Closed
garethr opened this issue Apr 1, 2015 · 2 comments · Fixed by #112
Closed

passingonly needs to be a boolean for watch type #97

garethr opened this issue Apr 1, 2015 · 2 comments · Fixed by #112

Comments

@garethr
Copy link

garethr commented Apr 1, 2015

Problem

The documentation contains the example:

consul::watch { 'my_watch':
  ...
  passingonly => 'true',
}

This results in a config file like:

{
  "watches": [
    {
     ...
     "passingonly": "true"
    }
  ]
}

This will in turn cause an issue for Consul starting with an error similar to:

==> Failed to parse watch (map[string]interface {}{"passingonly":"true", "handler":"/usr/bin/runpuppet.sh"}): Expecting %!s(MISSING) to be a boolean

Changing the config file by hand to the following fixes the problem.

"passingonly": true

Passing in the value to Puppet as a boolean also fixes the problem.

consul::watch { 'my_watch':
  ...
  passingonly => true,
}

Fix

  • Docs could be updated to show working values
  • Manifests could validate values being passed are booleans

Additional thoughts

  • This may affect other types which take booleans, and currently show passing strings in the READM.
  • This might be version specific, just in case:
consul --version
Consul v0.4.1
Consul Protocol: 2 (Understands back to: 1)
@solarkennedy
Copy link
Contributor

Yes please. PR?

@garethr
Copy link
Author

garethr commented Apr 1, 2015

I'll take a look when I get a moment, although it might be a week or so.

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 a pull request may close this issue.

2 participants