Skip to content

Commit 1a8e191

Browse files
towotdb
authored andcommitted
Fix readonly handling
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`.
1 parent 76b8d07 commit 1a8e191

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/puppet/provider/openldap_database/olc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def self.instances
5050
when %r{^olcRelay: }
5151
relay = line.split[1]
5252
when %r{^olcReadOnly: }i
53-
readonly = line.split[1]
53+
readonly = line.split[1] == 'TRUE' ? :true : :false
5454
when %r{^olcSizeLimit: }i
5555
sizelimit = line.split[1]
5656
when %r{^olcDbMaxSize: }i

lib/puppet/type/openldap_database.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ def should_to_s(_newvalue)
167167

168168
newproperty(:readonly) do
169169
desc 'Puts the database into read-only mode.'
170+
newvalues(:true, :false)
171+
defaultto(:false)
170172
end
171173

172174
newproperty(:sizelimit) do

0 commit comments

Comments
 (0)