summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphaël Pinson <raphael.pinson@camptocamp.com>2013-02-07 08:56:52 +0100
committerRaphaël Pinson <raphael.pinson@camptocamp.com>2013-02-07 08:56:52 +0100
commit69248dfd8ab09f6d78054d10c7162bb18ec040e5 (patch)
tree10241bc9265a18ff817a52f97b5d87d9b3792dd3
parent683ac8f8aa5f349ece98165d92a8d271b99b855e (diff)
downloadpuppet-stdlib-69248dfd8ab09f6d78054d10c7162bb18ec040e5.tar.gz
puppet-stdlib-69248dfd8ab09f6d78054d10c7162bb18ec040e5.tar.bz2
validate_cmd(): Use Puppet::Util::Execution.execute when available
-rw-r--r--lib/puppet/parser/functions/validate_cmd.rb6
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