Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lib/puppet/provider/openldap_global_conf/olc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,13 @@ def create
t << "add: olc#{resource[:name]}\n"
t << "olc#{resource[:name]}: #{resource[:value]}\n"
end
t.close
Puppet.debug(File.read(t.path))
begin
ldapmodify(t.path)
rescue Exception => e
raise Puppet::Error, "LDIF content:\n#{File.read t.path}\nError message: #{e.message}"
ensure
t.close
end
@property_hash[:ensure] = :present
end
Expand All @@ -99,12 +100,13 @@ def destroy
else
t << "delete: olc#{name}\n"
end
t.close
Puppet.debug(File.read(t.path))
begin
ldapmodify(t.path)
rescue Exception => e
raise Puppet::Error, "LDIF content:\n#{File.read t.path}\nError message: #{e.message}"
ensure
t.close
end
@property_hash.clear
end
Expand Down Expand Up @@ -139,12 +141,13 @@ def value=(value)
t << "replace: olc#{name}\n"
t << "olc#{name}: #{value}\n"
end
t.close
Puppet.debug(File.read(t.path))
begin
ldapmodify(t.path)
rescue Exception => e
raise Puppet::Error, "LDIF content:\n#{File.read t.path}\nError message: #{e.message}"
ensure
t.close
end
@property_hash[:value] = value
end
Expand Down