Codebase list facter / 2043244
(#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
3 changed file(s) with 6 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
6464 Facter.add(:ipaddress6) do
6565 confine :kernel => :windows
6666 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")
6868
6969 get_address_after_token(output, 'Address', true)
7070 end
7979 when 'HP-UX'
8080 output = %x{/bin/netstat -in | sed -e 1d}
8181 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|
8484 end
8585 output
8686 end
106106 return get_single_interface_output(interface) unless Facter.value(:kernel) == 'windows'
107107
108108 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}\"|
110110 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}\"|
112112 end
113113 output
114114 end
4343 Facter::Util::Config.stubs(:is_windows?).returns(true)
4444
4545 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').
4747 returns(fixture)
4848
4949 Facter.value(:ipaddress6).should == "2001:0:4137:9e76:2087:77a:53ef:7527"