From feecd393a6d6d94dcea913a3fdf7bb48d9f2e493 Mon Sep 17 00:00:00 2001 From: Ricky Zhou Date: Mon, 21 Dec 2009 15:34:54 -0500 Subject: Only ignore IPs starting with 127. --- lib/facter/ipaddress.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/facter/ipaddress.rb b/lib/facter/ipaddress.rb index 95cdc64..dd0d418 100644 --- a/lib/facter/ipaddress.rb +++ b/lib/facter/ipaddress.rb @@ -7,7 +7,7 @@ Facter.add(:ipaddress) do output.split(/^\S/).each { |str| if str =~ /inet addr:([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/ tmp = $1 - unless tmp =~ /127\./ + unless tmp =~ /^127\./ ip = tmp break end @@ -27,7 +27,7 @@ Facter.add(:ipaddress) do output.split(/^\S/).each { |str| if str =~ /inet ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/ tmp = $1 - unless tmp =~ /127\./ + unless tmp =~ /^127\./ ip = tmp break end @@ -47,7 +47,7 @@ Facter.add(:ipaddress) do output.split(/^\S/).each { |str| if str =~ /inet ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/ tmp = $1 - unless tmp =~ /127\./ + unless tmp =~ /^127\./ ip = tmp break end @@ -78,7 +78,7 @@ Facter.add(:ipaddress) do output.split(/^\S/).each { |str| if str =~ /inet ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/ tmp = $1 - unless tmp =~ /127\./ + unless tmp =~ /^127\./ ip = tmp break end @@ -98,7 +98,7 @@ Facter.add(:ipaddress) do output.split(/^\S/).each { |str| if str =~ /inet ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/ tmp = $1 - unless tmp =~ /127\./ + unless tmp =~ /^127\./ ip = tmp break end @@ -118,7 +118,7 @@ Facter.add(:ipaddress) do output.split(/^\S/).each { |str| if str =~ /IP Address.*: ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/ tmp = $1 - unless tmp =~ /127\./ + unless tmp =~ /^127\./ ip = tmp break end -- cgit