summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Badger <badgerea@hotmail.com>2013-08-19 18:20:46 -0500
committerEric Badger <badgerea@hotmail.com>2013-08-19 18:20:46 -0500
commit41be4c9b05b95fc0326ec19ebae0fdffea151f7c (patch)
tree091f9a4a2738cac8f9b874f50c7bbaeff4583d40
parent04fad243b3585a6da4ba3d363ae352c2fc2dee91 (diff)
Use Facter::Util::Resolution.which instead of `which ...`
If this plugin is synced to systems without the 'which' executable, backticked which will cause error messages.
-rw-r--r--lib/facter/acpi_available.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/facter/acpi_available.rb b/lib/facter/acpi_available.rb
index 9a0474f..dae057f 100644
--- a/lib/facter/acpi_available.rb
+++ b/lib/facter/acpi_available.rb
@@ -1,7 +1,7 @@
# return whether acpi is available -- used for deciding whether to install the munin plugin
Facter.add("acpi_available") do
setcode do
- if not File.exist? `which acpi 2>/dev/null`.chomp or `acpi -t -B -A 2>/dev/null`.match(/\d/).nil?
+ if not Facter::Util::Resolution.which('acpi') or `acpi -t -B -A 2>/dev/null`.match(/\d/).nil?
"absent"
else
"present"