]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
validate_cmd(): Use Puppet::Util::Execution.execute when available
authorRaphaël Pinson <raphael.pinson@camptocamp.com>
Thu, 7 Feb 2013 07:56:52 +0000 (08:56 +0100)
committerRaphaël Pinson <raphael.pinson@camptocamp.com>
Thu, 7 Feb 2013 07:56:52 +0000 (08:56 +0100)
lib/puppet/parser/functions/validate_cmd.rb

index 4f6a766c0bae6aa4baa93c61a1c611358897165a..344a80cd3652ad6c03b1f84944ef31baa96e05c1 100644 (file)
@@ -32,7 +32,11 @@ module Puppet::Parser::Functions
     tmpfile = Tempfile.new("validate_cmd")
     begin
       tmpfile.write(content)
-      Puppet::Util.execute("#{checkscript} #{tmpfile.path}")
+      if Puppet::Util::Execution.respond_to?('execute')
+        Puppet::Util::Execution.execute("#{checkscript} #{tmpfile.path}")
+      else
+        Puppet::Util.execute("#{checkscript} #{tmpfile.path}")
+      end
     rescue Puppet::ExecutionFailure => detail
       msg += "\n#{detail}"
       raise Puppet::ParseError, msg