diff --git a/lib/puppet/provider/openldap_access/olc.rb b/lib/puppet/provider/openldap_access/olc.rb index 380bd5d5..629815ce 100644 --- a/lib/puppet/provider/openldap_access/olc.rb +++ b/lib/puppet/provider/openldap_access/olc.rb @@ -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 && @@ -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