summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicky Zhou <ricky@fedoraproject.org>2009-12-21 15:34:54 -0500
committerPaul Nasrat <pnasrat@googlemail.com>2010-01-10 15:41:31 +0000
commitfeecd393a6d6d94dcea913a3fdf7bb48d9f2e493 (patch)
tree5cffc3c3a069c30a82e50b89e9fea340f4d7efdb
parent68fc123580dd54fb19a684c8b78bff9b19f0467a (diff)
downloadfacter-feecd393a6d6d94dcea913a3fdf7bb48d9f2e493.tar.gz
facter-feecd393a6d6d94dcea913a3fdf7bb48d9f2e493.tar.xz
facter-feecd393a6d6d94dcea913a3fdf7bb48d9f2e493.zip
Only ignore IPs starting with 127.
-rw-r--r--lib/facter/ipaddress.rb12
1 files 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