summaryrefslogtreecommitdiff
path: root/lib/puppet/parser
diff options
context:
space:
mode:
authorPeter Souter <p.souter@kainos.com>2014-12-18 23:08:13 +0000
committerPeter Souter <p.souter@kainos.com>2014-12-18 23:35:24 +0000
commitb3d007f1daa9bd7c8c02f372494df3a6e6ff6acf (patch)
treef1924d2aa4d29121748ff2f898ea7f5c5ff76e18 /lib/puppet/parser
parentcc8b147b5df539d1261508ed5c711a744d8584af (diff)
downloadpuppet-stdlib-b3d007f1daa9bd7c8c02f372494df3a6e6ff6acf.tar.gz
puppet-stdlib-b3d007f1daa9bd7c8c02f372494df3a6e6ff6acf.tar.bz2
(MODULES-1582) Improve % detection
Avoids any validate commands that have %'s in them other than "... % ..."
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/functions/validate_cmd.rb2
1 files changed, 1 insertions, 1 deletions
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}"