Return integers for openldap_database olcSecurity #353
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request (PR) description
Storytime!
I was pinned back on a 2.0.0 era module. One directive I had in play was:
I started looking at moving the module forward, and at 3.0.0 I hit
I changed the code,
And now every puppet run I started getting:
I haven't rolled the module all the way forward to see what I'd get, but what I see against module-master that is database.pp's typechecking requires integers as a value for security items (good), and provider openldap_database's security setter is happy to set olcSecurity to be anything (good). But provider openldap_database's security getter is reading the value back out as a string (bad). This leads to the disconnect I'm seeing since writing-
1
!= reading-'1'
.Most folks who require TLS on their ldap are probably requiring TLS at the server level instead of the database level, so it wouldn't surprise me if people haven't hit this.
"WHERE'S THE TESTS?!"
There aren't any currently, same as when it landed in #157. At that point it was a feature-add which long predated the type enforcements that began in module v3.0.0. I am unclear how I could clone
spec/unit/puppet/provider/openldap_overlay/olc_spec.rb
to test the read-it-back-out, so I'm submitting sans-tests. Sorry. The.to_i
change against module 2.0.0 fixed the "1 vs '1'" issue locally, and the code is effectively unmodified since it landed so it should port forward cleanly.This Pull Request (PR) fixes the following issues
Reported value of olcSecurity on a database are actually integers, but are being reported back as string-of-integer.