diff options
author | James Turnbull <james@lovedthanlost.net> | 2011-04-01 17:13:02 +1100 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2011-04-01 17:13:02 +1100 |
commit | d50db0cd74c8a198567db29ade75287f755a9bee (patch) | |
tree | 7af386cf78de97482c95c61fa93fe9e408f9f7b4 /lib | |
parent | 0b5b546e304fcf15a60f6489f89509e3bd2620f4 (diff) | |
parent | 56b5f10e876b29f9a2fd1906087ebb3cb5d47035 (diff) | |
download | facter-d50db0cd74c8a198567db29ade75287f755a9bee.tar.gz facter-d50db0cd74c8a198567db29ade75287f755a9bee.tar.xz facter-d50db0cd74c8a198567db29ade75287f755a9bee.zip |
Merge remote branch 'adrien/tickets/next/6613' into next
* adrien/tickets/next/6613:
(#6613) Switch solaris macaddress fact to netstat
Diffstat (limited to 'lib')
-rw-r--r-- | lib/facter/macaddress.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/facter/macaddress.rb b/lib/facter/macaddress.rb index 4a12384..bf23ef6 100644 --- a/lib/facter/macaddress.rb +++ b/lib/facter/macaddress.rb @@ -13,6 +13,18 @@ Facter.add(:macaddress) do end Facter.add(:macaddress) do + confine :operatingsystem => "Solaris" + setcode do + ether = [] + output = Facter::Util::Resolution.exec("/usr/bin/netstat -np") + output.each_line do |s| + ether.push($1) if s =~ /(?:SPLA)\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/ + end + ether[0] + end +end + +Facter.add(:macaddress) do confine :operatingsystem => %w{FreeBSD OpenBSD} setcode do ether = [] |