diff --git a/lib/puppet/provider/postgresql_psql/ruby.rb b/lib/puppet/provider/postgresql_psql/ruby.rb index 524d73c..60b4a0c 100644 --- a/lib/puppet/provider/postgresql_psql/ruby.rb +++ b/lib/puppet/provider/postgresql_psql/ruby.rb @@ -50,7 +50,12 @@ Puppet::Type.type(:postgresql_psql).provide(:ruby) do def run_command(command, user, group) command = command.join ' ' environment = get_environment - if Puppet::PUPPETVERSION.to_f < 3.4 + if Puppet::PUPPETVERSION.to_f < 3.0 + require 'puppet/util/execution' + Puppet::Util::Execution.withenv environment do + Puppet::Util::SUIDManager.run_and_capture(command, user, group) + end + elsif Puppet::PUPPETVERSION.to_f < 3.4 Puppet::Util.withenv environment do Puppet::Util::SUIDManager.run_and_capture(command, user, group) end