From d15419f0d0d720d1dad9c0bdf972353ef0e757ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20M=E4kinen?= Date: Mon, 10 Jun 2013 13:08:24 +0300 Subject: [PATCH] network: Changed get_address_after_token function name from ipv6enabled fact to prevent collision with ipaddress6 fact. --- network/lib/facter/ipv6enabled.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/network/lib/facter/ipv6enabled.rb b/network/lib/facter/ipv6enabled.rb index fb9a0f9..3f97e99 100644 --- a/network/lib/facter/ipv6enabled.rb +++ b/network/lib/facter/ipv6enabled.rb @@ -4,7 +4,7 @@ # # Based on ipaddress6 fact written Cody Herriges . -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