From 47ab296f36f66075554b4ccdb7553b0154bedfd0 Mon Sep 17 00:00:00 2001 From: Jan Fabry Date: Thu, 28 Apr 2016 23:24:48 +0200 Subject: [PATCH] Don't overwrite or calculate the environment twice MODULES-3311 --- lib/puppet/provider/postgresql_psql/ruby.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/puppet/provider/postgresql_psql/ruby.rb b/lib/puppet/provider/postgresql_psql/ruby.rb index a2819dc..166c8bc 100644 --- a/lib/puppet/provider/postgresql_psql/ruby.rb +++ b/lib/puppet/provider/postgresql_psql/ruby.rb @@ -30,7 +30,7 @@ Puppet::Type.type(:postgresql_psql).provide(:ruby) do private def get_environment - environment = resource[:connect_settings] || {} + environment = (resource[:connect_settings] || {}).dup if envlist = resource[:environment] envlist = [envlist] unless envlist.is_a? Array envlist.each do |setting| @@ -55,7 +55,6 @@ Puppet::Type.type(:postgresql_psql).provide(:ruby) do def run_command(command, user, group, environment) command = command.join ' ' - environment = get_environment if Puppet::PUPPETVERSION.to_f < 3.0 require 'puppet/util/execution' Puppet::Util::Execution.withenv environment do