network: Changed get_address_after_token function name from ipv6enabled fact to prevent collision with ipaddress6 fact.

This commit is contained in:
Timo Mkinen 2013-06-10 13:08:24 +03:00
parent cb88e1aa0a
commit d15419f0d0

View file

@ -4,7 +4,7 @@
#
# Based on ipaddress6 fact written Cody Herriges <c.a.herriges@gmail.com>.
def get_address_after_token(output, token)
def check_for_ipv6_address(output, token)
ret = false
output.scan(/#{token} ((?>[0-9,a-f,A-F]*\:{1,2})+[0-9,a-f,A-F]{0,4})/).each do |match|
ret = true
@ -18,7 +18,7 @@ Facter.add(:ipv6enabled) do
setcode do
output = Facter::Util::IP.exec_ifconfig(["2>/dev/null"])
get_address_after_token(output, 'inet6 addr:')
check_for_ipv6_address(output, 'inet6 addr:')
end
end
@ -27,7 +27,7 @@ Facter.add(:ipv6enabled) do
setcode do
output = Facter::Util::IP.exec_ifconfig(["-a"])
get_address_after_token(output, 'inet6')
check_for_ipv6_address(output, 'inet6')
end
end
@ -36,7 +36,7 @@ Facter.add(:ipv6enabled) do
setcode do
output = Facter::Util::IP.exec_ifconfig(["-a"])
get_address_after_token(output, 'inet6')
check_for_ipv6_address(output, 'inet6')
end
end
@ -45,6 +45,6 @@ Facter.add(:ipv6enabled) do
setcode do
output = Facter::Util::Resolution.exec("#{ENV['SYSTEMROOT']}/system32/netsh.exe interface ipv6 show address level=verbose")
get_address_after_token(output, 'Address')
check_for_ipv6_address(output, 'Address')
end
end