Don't overwrite or calculate the environment twice

MODULES-3311
This commit is contained in:
Jan Fabry 2016-04-28 23:24:48 +02:00
parent 275e6f9d24
commit 47ab296f36

View file

@ -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