(#13678) Remove deprecation msg triggerd by the ipaddress6 fact
Facter::Util::Resolution.exec tries to get the expanded path to the
binary by calling Facter::Util::Resolution.which. This works for
relative commands (if the command is found in PATH). If the binary
describes an absolute path on windows but lacks a filename extension
Facter::Util::Resolution.which will also try to find the correct
extension, so the final binary passes a File.executable? check.
However, this behaviour (passing an absolute path but omit the
extension) is marked as deprecated.
Remove every occurence of Facter::Util::Resolution.exec where a binary
is passed without the correct filename extension.
Stefan Schulte
11 years ago
64 | 64 |
Facter.add(:ipaddress6) do
|
65 | 65 |
confine :kernel => :windows
|
66 | 66 |
setcode do
|
67 | |
output = Facter::Util::Resolution.exec("#{ENV['SYSTEMROOT']}/system32/netsh interface ipv6 show address level=verbose")
|
|
67 |
output = Facter::Util::Resolution.exec("#{ENV['SYSTEMROOT']}/system32/netsh.exe interface ipv6 show address level=verbose")
|
68 | 68 |
|
69 | 69 |
get_address_after_token(output, 'Address', true)
|
70 | 70 |
end
|
79 | 79 |
when 'HP-UX'
|
80 | 80 |
output = %x{/bin/netstat -in | sed -e 1d}
|
81 | 81 |
when 'windows'
|
82 | |
output = %x|#{ENV['SYSTEMROOT']}/system32/netsh interface ip show interface|
|
83 | |
output += %x|#{ENV['SYSTEMROOT']}/system32/netsh interface ipv6 show interface|
|
|
82 |
output = %x|#{ENV['SYSTEMROOT']}/system32/netsh.exe interface ip show interface|
|
|
83 |
output += %x|#{ENV['SYSTEMROOT']}/system32/netsh.exe interface ipv6 show interface|
|
84 | 84 |
end
|
85 | 85 |
output
|
86 | 86 |
end
|
|
106 | 106 |
return get_single_interface_output(interface) unless Facter.value(:kernel) == 'windows'
|
107 | 107 |
|
108 | 108 |
if label == 'ipaddress6'
|
109 | |
output = %x|#{ENV['SYSTEMROOT']}/system32/netsh interface ipv6 show address \"#{interface}\"|
|
|
109 |
output = %x|#{ENV['SYSTEMROOT']}/system32/netsh.exe interface ipv6 show address \"#{interface}\"|
|
110 | 110 |
else
|
111 | |
output = %x|#{ENV['SYSTEMROOT']}/system32/netsh interface ip show address \"#{interface}\"|
|
|
111 |
output = %x|#{ENV['SYSTEMROOT']}/system32/netsh.exe interface ip show address \"#{interface}\"|
|
112 | 112 |
end
|
113 | 113 |
output
|
114 | 114 |
end
|
43 | 43 |
Facter::Util::Config.stubs(:is_windows?).returns(true)
|
44 | 44 |
|
45 | 45 |
fixture = netsh_fixture('windows_netsh_addresses_with_multiple_interfaces')
|
46 | |
Facter::Util::Resolution.stubs(:exec).with('d:/windows/system32/netsh interface ipv6 show address level=verbose').
|
|
46 |
Facter::Util::Resolution.stubs(:exec).with('d:/windows/system32/netsh.exe interface ipv6 show address level=verbose').
|
47 | 47 |
returns(fixture)
|
48 | 48 |
|
49 | 49 |
Facter.value(:ipaddress6).should == "2001:0:4137:9e76:2087:77a:53ef:7527"
|