From b3d007f1daa9bd7c8c02f372494df3a6e6ff6acf Mon Sep 17 00:00:00 2001
From: Peter Souter
Date: Thu, 18 Dec 2014 23:08:13 +0000
Subject: (MODULES-1582) Improve % detection
Avoids any validate commands that have %'s in them other than "... % ..."
---
lib/puppet/parser/functions/validate_cmd.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/puppet/parser/functions/validate_cmd.rb b/lib/puppet/parser/functions/validate_cmd.rb
index 7290265..5df3c60 100644
--- a/lib/puppet/parser/functions/validate_cmd.rb
+++ b/lib/puppet/parser/functions/validate_cmd.rb
@@ -39,7 +39,7 @@ module Puppet::Parser::Functions
tmpfile.write(content)
tmpfile.close
- if checkscript.include?('%')
+ if checkscript =~ /\s%(\s|$)/
check_with_correct_location = checkscript.gsub(/%/,tmpfile.path)
else
check_with_correct_location = "#{checkscript} #{tmpfile.path}"
--
cgit v1.2.3