[Pkg-puppet-devel] [SCM] Packaging of Facter for debian branch, experimental, updated. debian/1.5.8-2-160-gb26a2a8
Todd Zullinger
tmz at pobox.com
Tue May 10 08:39:55 UTC 2011
The following commit has been merged in the experimental branch:
commit f39d48745dc6b54f33d505bfe33e875089b2907d
Author: Todd Zullinger <tmz at pobox.com>
Date: Fri Mar 18 08:42:17 2011 -0400
(#6763) Use Facter::Util::Resolution.exec for arp
The arp command is in /sbin on Fedora/RHEL, not /usr/sbin. Using
Facter::Util::Resolution.exec is preferable to hard-coding the path.
diff --git a/lib/facter/arp.rb b/lib/facter/arp.rb
index 65cf4c3..5035ad0 100644
--- a/lib/facter/arp.rb
+++ b/lib/facter/arp.rb
@@ -4,9 +4,11 @@ Facter.add(:arp) do
confine :kernel => :linux
setcode do
arp = []
- output = %x{/usr/sbin/arp -a}
- output.each_line do |s|
- arp.push($1) if s =~ /^\S+\s\S+\s\S+\s(\S+)\s\S+\s\S+\s\S+$/
+ output = Facter::Util::Resolution.exec('arp -a')
+ if not output.nil?
+ output.each_line do |s|
+ arp.push($1) if s =~ /^\S+\s\S+\s\S+\s(\S+)\s\S+\s\S+\s\S+$/
+ end
end
arp[0]
end
--
Packaging of Facter for debian
More information about the Pkg-puppet-devel
mailing list