Skip to content

Commit

Permalink
Fix readonly handling
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
towo authored and tdb committed May 23, 2024
1 parent 76b8d07 commit 1a8e191
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/puppet/provider/openldap_database/olc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def self.instances
when %r{^olcRelay: }
relay = line.split[1]
when %r{^olcReadOnly: }i
readonly = line.split[1]
readonly = line.split[1] == 'TRUE' ? :true : :false
when %r{^olcSizeLimit: }i
sizelimit = line.split[1]
when %r{^olcDbMaxSize: }i
Expand Down
2 changes: 2 additions & 0 deletions lib/puppet/type/openldap_database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
end

newproperty(:sizelimit) do
Expand Down

0 comments on commit 1a8e191

Please sign in to comment.