Merge pull request #761 from janfabry/MODULES-3311-environment-duplication

Don't overwrite or calculate the environment twice
This commit is contained in:
JT (Jonny) 2016-05-12 16:24:35 +01:00
commit f040dd2d72

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