diff options
author | Raphaël Pinson <raphael.pinson@camptocamp.com> | 2013-02-07 08:56:52 +0100 |
---|---|---|
committer | Raphaël Pinson <raphael.pinson@camptocamp.com> | 2013-02-07 08:56:52 +0100 |
commit | 69248dfd8ab09f6d78054d10c7162bb18ec040e5 (patch) | |
tree | 10241bc9265a18ff817a52f97b5d87d9b3792dd3 /lib | |
parent | 683ac8f8aa5f349ece98165d92a8d271b99b855e (diff) |
validate_cmd(): Use Puppet::Util::Execution.execute when available
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/parser/functions/validate_cmd.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/puppet/parser/functions/validate_cmd.rb b/lib/puppet/parser/functions/validate_cmd.rb index 4f6a766..344a80c 100644 --- a/lib/puppet/parser/functions/validate_cmd.rb +++ b/lib/puppet/parser/functions/validate_cmd.rb @@ -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 |