From: Stephen Gran Date: Sun, 7 Mar 2010 21:59:00 +0000 (+0000) Subject: match subnets that might exist X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=08102df3baf78bb0f4b4d99410c5a93bb282f673;p=mirror%2Fdsa-puppet.git match subnets that might exist Signed-off-by: Stephen Gran --- diff --git a/facts/ipaddresses.rb b/facts/ipaddresses.rb index 17dbd84ae..d03bbbc4e 100644 --- a/facts/ipaddresses.rb +++ b/facts/ipaddresses.rb @@ -4,7 +4,7 @@ Facter.add("v4ips") do %x{ip addr list}.each do |line| next unless line =~ /\s+inet/ next if line =~ /scope (link|host)/ - if line =~ /\s+inet\s+(\S+)\/\d\d .*/ + if line =~ /\s+inet\s+(\S+)\/\d{1,2} .*/ addrs << $1 end end @@ -19,7 +19,7 @@ Facter.add("v6ips") do %x{ip addr list}.each do |line| next unless line =~ /\s+inet/ next if line =~ /scope (link|host)/ - if line =~ /\s+inet6\s+(\S+)\/\d\d .*/ + if line =~ /\s+inet6\s+(\S+)\/\d{1,3} .*/ addrs << $1 end end