diff options
Diffstat (limited to 'lib/puppet/util')
-rw-r--r-- | lib/puppet/util/command_line.rb | 2 | ||||
-rw-r--r-- | lib/puppet/util/reference.rb | 9 |
2 files changed, 2 insertions, 9 deletions
diff --git a/lib/puppet/util/command_line.rb b/lib/puppet/util/command_line.rb index 2a97ee069..3562a3dc0 100644 --- a/lib/puppet/util/command_line.rb +++ b/lib/puppet/util/command_line.rb @@ -62,7 +62,7 @@ module Puppet external_command = "puppet-#{subcommand_name}" require 'puppet/util' - path_to_subcommand = Puppet::Util.binary( external_command ) + path_to_subcommand = Puppet::Util.which( external_command ) return false unless path_to_subcommand system( path_to_subcommand, *args ) diff --git a/lib/puppet/util/reference.rb b/lib/puppet/util/reference.rb index ab201cde4..95efeb1c1 100644 --- a/lib/puppet/util/reference.rb +++ b/lib/puppet/util/reference.rb @@ -39,14 +39,7 @@ class Puppet::Util::Reference Puppet::Util.secure_open("/tmp/puppetdoc.txt", "w") do |f| f.puts text end - rst2latex = %x{which rst2latex} - if $CHILD_STATUS != 0 or rst2latex =~ /no / - rst2latex = %x{which rst2latex.py} - end - if $CHILD_STATUS != 0 or rst2latex =~ /no / - raise "Could not find rst2latex" - end - rst2latex.chomp! + rst2latex = which('rst2latex') || which('rst2latex.py') || raise("Could not find rst2latex") cmd = %{#{rst2latex} /tmp/puppetdoc.txt > /tmp/puppetdoc.tex} Puppet::Util.secure_open("/tmp/puppetdoc.tex","w") do |f| # If we get here without an error, /tmp/puppetdoc.tex isn't a tricky cracker's symlink |