Subject: | Patch for PIX::Object::network |
Date: | Mon, 12 Mar 2007 22:20:22 -0400 |
To: | bug-PIX-Walker [...] rt.cpan.org |
From: | "Ryan Shea" <ryan [...] muppethouse.com> |
I use rancid to pull configs. For some reason sometimes it fails to
grab a leading space. This is not a bug with your module - but I
think \s* would be reasonable in the regular expression instead of
requiring at least one space and it would fix this problem for me.
Besides, it looks like you do not require a space for the group-object
case.
--- network.pm 2006-06-07 13:10:02.000000000 -0400
+++ network.pm.new 2007-03-12 22:12:27.000000000 -0400
@@ -29,7 +29,7 @@
$self->add($ip, $mask);
} elsif ($line =~ /^\s*group-object (\S+)/) {
push(@{$self->{groups}}, $1);
- } elsif ($line =~ /^\s+description (.+)/) {
+ } elsif ($line =~ /^\s*description (.+)/) {
$self->{desc} = $1;
} else {
warn "$self->{name}: Unknown network object
line: $line\n";