]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
(MODULES-1582) Improve % detection
authorPeter Souter <p.souter@kainos.com>
Thu, 18 Dec 2014 23:08:13 +0000 (23:08 +0000)
committerPeter Souter <p.souter@kainos.com>
Thu, 18 Dec 2014 23:35:24 +0000 (23:35 +0000)
Avoids any validate commands that have %'s in them other than "... % ..."

lib/puppet/parser/functions/validate_cmd.rb

index 729026531305d2229305e3f2edd50ea0323f993f..5df3c6094cb5958346c4944d4fb3a85133d26498 100644 (file)
@@ -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}"