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

Fix readonly database property #422

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

tdb
Copy link
Contributor

@tdb tdb commented May 23, 2024

The database readonly property expects a boolean, but the olc provider doesn't take care to parse the existing value into a boolean, thus leading to issues.

Simply applies the same logic applied to olcMirrorMode for olcReadOnly.

Fixes #207
Fixes #358

@tdb
Copy link
Contributor Author

tdb commented May 23, 2024

Squashed and rebased as requested @smortex. Not convinced the spec tests work correctly though.

Copy link
Member

@smortex smortex left a comment

Choose a reason for hiding this comment

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

Not convinced the spec tests work correctly though.

Tests are run by GitHub and show what is found vs what was expected. CI failed at an earlier stage but fixing the issue above bellow should allow it to continue. In any case, if you want to run these tests on your machine you can:

bundle exec rake spec_prep
bundle exec rspec spec/unit/puppet/provider/openldap_database/olc_spec.rb

@@ -167,6 +167,8 @@ def should_to_s(_newvalue)

newproperty(:readonly) do
desc 'Puts the database into read-only mode.'
newvalues(:true, :false)
defaultto(:false)
Copy link
Member

Choose a reason for hiding this comment

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

I guess the new default value is the reason for the CI failue:

REFERENCE.md is outdated

Please update REFERENCE.md with

$ bundle exec rake strings:generate:reference

Add it to the PR and CI should continue.

The database `readonly` property expects a boolean, but the olc
provider doesn't take care to parse the existing value into a boolean,
thus leading to issues.

Simply applies the same logic applied to `olcMirrorMode` for
`olcReadOnly`.
@tdb
Copy link
Contributor Author

tdb commented Jun 12, 2024

This is failing on the tests. I'm not 100% sure exactly what the original author intended, and I don't have enough knowledge of RSpec to fix it I'm afraid.

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.

Unable to set database to readonly
3 participants