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

Comments

Projects
None yet
3 participants
@sethrosenblum
Copy link
Member

sethrosenblum commented Apr 27, 2016

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

This comment has been minimized.

Copy link
Collaborator

miketheman commented May 2, 2016

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

@sethrosenblum

This comment has been minimized.

Copy link
Member Author

sethrosenblum commented May 3, 2016

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

Fix postgres template syntax and parameter output
- 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

This comment has been minimized.

Copy link
Collaborator

miketheman commented May 3, 2016

@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

Fix postgres template syntax and parameter output (#304)
- 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

This comment has been minimized.

Copy link
Collaborator

miketheman commented May 4, 2016

@sethrosenblum Released in 2.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.