Skip to content

fix undef variable check puppet6#480

Closed
fe80 wants to merge 3 commits into
voxpupuli:masterfrom
fe80:puppet6_ldap
Closed

fix undef variable check puppet6#480
fe80 wants to merge 3 commits into
voxpupuli:masterfrom
fe80:puppet6_ldap

Conversation

@fe80
Copy link
Copy Markdown

@fe80 fe80 commented Nov 20, 2021

Hello,

The variable check of some template not work with puppet6

Comment thread templates/_auth_ldap.erb Outdated
authenticationMethod="simple"
forceBindingLogin="<%= @auth_config['ldap']['force_binding'] %>"
<%- if @auth_config['ldap']['force_binding_use_root'] != :undef -%>
<%- if !@auth_config['ldap']['force_binding_use_root'].nil? && @auth_config['ldap']['force_binding_use_root'] != :undef -%>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Considering force_binding_use_root defaults to false and not undef, I'm not convinced this conditional is needed at all.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@fe80 I've taken the liberty of pushing a commit onto your branch (something you can turn off when you open a PR) that removes this conditional and adds a test for this ldap property. Hoping you could follow the pattern and add tests for the other properties you've fixed? Feel free to discard/squash it if you want to add more tests or write them in a different way. :)

@alexjfisher
Copy link
Copy Markdown
Member

Thanks for the PR! I think I've come across a similar fix in another module before. So we can confirm everything now works correctly (and won't be broken in future), would you be able to write any tests?

Since _this_ parameter actually defaults to `false` and not `undef` the
template doesn't need the conditional.
@fe80
Copy link
Copy Markdown
Author

fe80 commented Nov 22, 2021

I've had more test and fix a bug (I've miss a .nil? condition)

@kenyon
Copy link
Copy Markdown
Member

kenyon commented Dec 4, 2023

Obsoleted by #520.

@kenyon kenyon closed this Dec 4, 2023
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.

4 participants