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

TemplateError in postgres.yaml #300

Closed
sethrosenblum opened this issue Apr 27, 2016 · 4 comments
Closed

TemplateError in postgres.yaml #300

sethrosenblum opened this issue Apr 27, 2016 · 4 comments
Assignees
Labels
Milestone

Comments

@sethrosenblum
Copy link
Contributor

Seeing this error when running chef-client on a host with the postgres check enabled:

      ================================================================================
      Error executing action `create` on resource 'template[/etc/dd-agent/conf.d/postgres.yaml]'
      ================================================================================

      Chef::Mixin::Template::TemplateError
      ------------------------------------
      Undefined node attribute or method `keys?' on `node'

      Resource Declaration:
      ---------------------
      suppressed sensitive resource output

      Compiled Resource:
      ------------------
      suppressed sensitive resource output

      Template Context:
      -----------------
      on line #28
       26:         <% end -%>
       27:     <% end -%>
       28:     <% if i.keys?("collect_function_metrics") -%>
       29:     collect_function_metrics: i["collect_function_metrics"]
       30:     <% end -%>

This looks to be a result of #278 . The i object here is an ImmutableHash so we probably want to run i.key?('collect_function_metrics') here.

@miketheman
Copy link
Contributor

See proposed fix in #302. This looks to apply the desired change.

@sethrosenblum
Copy link
Contributor Author

This is a showstopper for anyone using the postgres check. Any chance we could hotfix this out while waiting for someone to rewrite spec tests?

miketheman added a commit that referenced this issue May 3, 2016
- Use correct `.key?` syntax, Fix #300
- Emit correct boolean, introduced in #278
- Add postgres spec test

Closes #302

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
@miketheman miketheman modified the milestone: 2.3.1 May 3, 2016
@miketheman
Copy link
Contributor

@sethrosenblum Please review #304 - it fixes another bug in the parameter wrapped in the if in the first place.

@miketheman miketheman added the bug label May 3, 2016
miketheman added a commit that referenced this issue May 4, 2016
- Use correct `.key?` syntax, Fix #300
- Emit correct boolean, introduced in #278
- Add postgres spec test

Closes #302

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
@miketheman miketheman modified the milestones: 2.4.0, 2.3.1 May 4, 2016
@miketheman
Copy link
Contributor

@sethrosenblum Released in 2.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants