match subnets that might exist
authorStephen Gran <steve@lobefin.net>
Sun, 7 Mar 2010 21:59:00 +0000 (21:59 +0000)
committerStephen Gran <steve@lobefin.net>
Sun, 7 Mar 2010 21:59:00 +0000 (21:59 +0000)
Signed-off-by: Stephen Gran <steve@lobefin.net>
facts/ipaddresses.rb

index 17dbd84..d03bbbc 100644 (file)
@@ -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