pf-tools commit: r577 [ccaillet-guest] - in /trunk: debian/changelog lib/PFTools/Net.pm

parmelan-guest at users.alioth.debian.org parmelan-guest at users.alioth.debian.org
Tue Feb 5 14:03:28 UTC 2008


Author: ccaillet-guest
Date: Tue Feb  5 14:03:27 2008
New Revision: 577

URL: http://svn.debian.org/wsvn/pf-tools/?sc=1&rev=577
Log:
* factorizing code for route/delroute definition in Add_server from Net.pm

Modified:
    trunk/debian/changelog
    trunk/lib/PFTools/Net.pm

Modified: trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pf-tools/trunk/debian/changelog?rev=577&op=diff
==============================================================================
--- trunk/debian/changelog (original)
+++ trunk/debian/changelog Tue Feb  5 14:03:27 2008
@@ -31,6 +31,7 @@
     for the vlan
   * adding ERR: message and aborting when two interfaces are on the same vlan
     for a same host
+  * factorizing code for route/delroute definition in Add_server from Net.pm
 
   [ Thomas Parmelan ]
   * lib-net: if no comment is specified in a zone, network or server
@@ -42,7 +43,7 @@
   * Update my email address.
   * Merge the remaining changes from 0.32.47-1 and 0.32.48-1.
 
- -- Christophe Caillet <quadchris at free.fr>  Tue, 05 Feb 2008 13:36:08 +0100
+ -- Christophe Caillet <quadchris at free.fr>  Tue, 05 Feb 2008 15:01:59 +0100
 
 pf-tools (0.32.48-1) unstable; urgency=low
 

Modified: trunk/lib/PFTools/Net.pm
URL: http://svn.debian.org/wsvn/pf-tools/trunk/lib/PFTools/Net.pm?rev=577&op=diff
==============================================================================
--- trunk/lib/PFTools/Net.pm (original)
+++ trunk/lib/PFTools/Net.pm Tue Feb  5 14:03:27 2008
@@ -1175,35 +1175,18 @@
 		# Traitement des routes
 		my $r;
 		foreach $r ( keys %{ $S->{$i} } ) {
-		    if ( $r =~ m/^route/ ) {
+		    if ( $r =~ m/^(route|delroute)/ ) {
+			my $act = $1 ;
 			if ( ref ( $S->{$i}->{$r} ) eq 'HASH' ) {
 			    if ( defined $S->{$i}->{$r}->{$mnamindexnum} ) {
-				$M->{'route'}->{$j}->{$r} = $S->{$i}->{$r}->{$mnamindexnum} ;
+				$M->{$act}->{$j}->{$r} = $S->{$i}->{$r}->{$mnamindexnum} ;
 			    } elsif ( ! defined $S->{$i}->{$r}->{'default'} ) {
 				Abort ( $ERR_SYNTAX, "No default route defined for interface ".$i ) ;
 			    } else {
-				$M->{'route'}->{$j}->{$r} = $S->{$i}->{$r}->{'default'} ;
+				$M->{$act}->{$j}->{$r} = $S->{$i}->{$r}->{'default'} ;
 			    }
 			} else {
-			    $M->{'route'}->{$j}->{$r} = $S->{$i}->{$r};
-			}
-		    }
-		}
-
-		# Traitement des suppressions de routes
-		my $dr;
-		foreach $dr ( keys %{ $S->{$i} } ) {
-		    if ( $dr =~ m/^delroute/ ) {
-			if ( ref ( $S->{$i}->{$r} ) eq 'HASH' ) {
-			    if ( defined $S->{$i}->{$r}->{$mnamindexnum} ) {
-				$M->{'delroute'}->{$j}->{$r} = $S->{$i}->{$r}->{$mnamindexnum} ;
-			    } elsif ( ! defined $S->{$i}->{$r}->{'default'} ) {
-				Abort ( $ERR_SYNTAX, "No default route defined for interface ".$i ) ;
-			    } else {
-				$M->{'delroute'}->{$j}->{$r} = $S->{$i}->{$r}->{'default'} ;
-			    }
-			} else {
-			    $M->{'delroute'}->{$j}->{$r} = $S->{$i}->{$r};
+			    $M->{$act}->{$j}->{$r} = $S->{$i}->{$r};
 			}
 		    }
 		}




More information about the pf-tools-commits mailing list