diff options
author | Adam Jacob <adam@hjksolutions.com> | 2008-10-03 08:56:35 -0700 |
---|---|---|
committer | Adam Jacob <adam@hjksolutions.com> | 2008-10-03 08:56:35 -0700 |
commit | 07e2aea0aa2926df2e819469d97e95a6bbd7515c (patch) | |
tree | 6471a4eedd5d5a7f3cd9d855d41726b11461f28e /lib | |
parent | a0ca800cd42eac4de599a0f221ecd3422fdc8c10 (diff) | |
download | chef-07e2aea0aa2926df2e819469d97e95a6bbd7515c.tar.gz |
Using @node[:ps], so Facter is totally abstracted from Chef
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/provider/service/init.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/provider/service/init.rb b/lib/chef/provider/service/init.rb index 2571b8ff97..0ccfc232d8 100644 --- a/lib/chef/provider/service/init.rb +++ b/lib/chef/provider/service/init.rb @@ -36,12 +36,12 @@ class Chef Chef::Log.debug("#{@new_resource} does not support status and you have not specified a status command, falling back to process table inspection") if @new_resource.pattern == @new_resource.service_name Chef::Log.debug("#{@new_resource} defaulting pattern to #{Regex.new(@new_resource.pattern)}") - elsif Facter["ps"].value == "" + elsif @node[:ps] == "" raise Chef::Exception::Service, "#{@new_resource}: Facter could not determine how to call `ps` on your system (#{Facter["ps"].value})" end process_pid = nil - status = popen4(Facter["ps"].value) do |pid, stdin, stdout, stderr| + status = popen4(@node[:ps]) do |pid, stdin, stdout, stderr| stdin.close r = Regexp.new(@new_resource.pattern) Chef::Log.debug("#{@new_resource}: attempting to match #{@new_resource.pattern} (#{r}) against process table") @@ -52,10 +52,10 @@ class Chef end end unless status.exitstatus == 0 - raise Chef::Exception::Service, "Command #{Facter["ps"].value} failed" + raise Chef::Exception::Service, "Command #{@node[:ps]} failed" else process_pid ? process_running = true : process_running = false - Chef::Log.debug("#{@new_resource}: #{Facter["ps"].value} exited succesfully, process_running: #{process_running}") + Chef::Log.debug("#{@new_resource}: #{@node[:ps]} exited succesfully, process_running: #{process_running}") end end @current_resource.running process_running |