From 9e0d8a8e0a83e1659fdb289078fd15862dca028b Mon Sep 17 00:00:00 2001 From: sgzijl Date: Mon, 9 Sep 2013 16:20:36 +0200 Subject: (#22214): close content file before executing checkscript Right now validation seems to be done against zero byte generated temp files. We need to close the file before executing validation against it. --- lib/puppet/parser/functions/validate_cmd.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/puppet/parser/functions/validate_cmd.rb') diff --git a/lib/puppet/parser/functions/validate_cmd.rb b/lib/puppet/parser/functions/validate_cmd.rb index 344a80c..2ebe91c 100644 --- a/lib/puppet/parser/functions/validate_cmd.rb +++ b/lib/puppet/parser/functions/validate_cmd.rb @@ -32,6 +32,7 @@ module Puppet::Parser::Functions tmpfile = Tempfile.new("validate_cmd") begin tmpfile.write(content) + tmpfile.close if Puppet::Util::Execution.respond_to?('execute') Puppet::Util::Execution.execute("#{checkscript} #{tmpfile.path}") else -- cgit v1.2.3