(#12147) Remove Darwin 6-specific iphostnumber fact
The iphostnumber fact only resolves on version 6 of the Darwin kernel.
This commit removes a fact that only exists on an unsupported platform.
(aka Jaguar). The official minimum supported version is 8 (aka Tiger).
Darwin 6 was replaced with Panther in October 2003.
Jeff Weiss
12 years ago
0 | # Fact: iphostnumber | |
1 | # | |
2 | # Purpose: On selected versions of Darwin, returns the host's IP address. | |
3 | # | |
4 | # Resolution: | |
5 | # Uses either the scutil program to get the localhost name, or parses output | |
6 | # of ifconfig for a MAC address. | |
7 | # | |
8 | # Caveats: | |
9 | # | |
10 | ||
11 | Facter.add(:iphostnumber) do | |
12 | confine :kernel => :darwin, :kernelrelease => "R6" | |
13 | setcode do | |
14 | %x{/usr/sbin/scutil --get LocalHostName} | |
15 | end | |
16 | end | |
17 | Facter.add(:iphostnumber) do | |
18 | confine :kernel => :darwin, :kernelrelease => "R6" | |
19 | setcode do | |
20 | ether = nil | |
21 | output = %x{/sbin/ifconfig} | |
22 | ||
23 | output =~ /HWaddr (\w\w:\w\w:\w\w:\w\w:\w\w:\w\w)/ | |
24 | ether = $1 | |
25 | ||
26 | ether | |
27 | end | |
28 | end |