Skip to content

Commit 47ab296

Browse files
committed
Don't overwrite or calculate the environment twice
MODULES-3311
1 parent 275e6f9 commit 47ab296

File tree

1 file changed

+1
-2
lines changed
  • lib/puppet/provider/postgresql_psql

1 file changed

+1
-2
lines changed

lib/puppet/provider/postgresql_psql/ruby.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def run_sql_command(sql)
3030
private
3131

3232
def get_environment
33-
environment = resource[:connect_settings] || {}
33+
environment = (resource[:connect_settings] || {}).dup
3434
if envlist = resource[:environment]
3535
envlist = [envlist] unless envlist.is_a? Array
3636
envlist.each do |setting|
@@ -55,7 +55,6 @@ def get_environment
5555

5656
def run_command(command, user, group, environment)
5757
command = command.join ' '
58-
environment = get_environment
5958
if Puppet::PUPPETVERSION.to_f < 3.0
6059
require 'puppet/util/execution'
6160
Puppet::Util::Execution.withenv environment do

0 commit comments

Comments
 (0)