Skip to content

Commit

Permalink
Fix setting ACL if they had been set before
Browse files Browse the repository at this point in the history
  • Loading branch information
fklajn committed Sep 7, 2018
1 parent ae8715a commit ad2570c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/puppet/provider/openldap_access/olc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def self.prefetch(resources)
if provider = accesses.find{ |access|
if resources[name][:position]
access.suffix == resources[name][:suffix] &&
access.position == resources[name][:position]
access.position == resources[name][:position].to_s
else
access.suffix == resources[name][:suffix] &&
access.access.flatten == resources[name][:access].flatten &&
Expand Down Expand Up @@ -105,7 +105,17 @@ def self.getDn(suffix)
def getDn(*args); self.class.getDn(*args); end

def exists?
@property_hash[:ensure] == :present
acls = self.class.instances.map { | instance |
{
:position => instance.position,
:suffix => instance.suffix
}
}
acl = {
:position => resource[:position].to_s,
:suffix => resource[:suffix]
}
acls.include?(acl)
end

def create
Expand Down

0 comments on commit ad2570c

Please sign in to comment.