pf-tools commit: r704 [ccaillet-guest] - in /trunk: debian/changelog debian/control filters/filter_distrib lib/PFTools/Conf.pm lib/PFTools/Net.pm lib/PFTools/Update.pm

parmelan-guest at users.alioth.debian.org parmelan-guest at users.alioth.debian.org
Wed Mar 18 15:27:29 UTC 2009


Author: ccaillet-guest
Date: Wed Mar 18 15:27:29 2009
New Revision: 704

URL: http://svn.debian.org/wsvn/pf-tools/?sc=1&rev=704
Log:
* debian/control
  - added myself as uploder to please dch
  - pf-host: depends: libdigest-crc-perl
* filters/filter_distrib:
  - exit with a proper error message if the specified host does not exist or
    its configuration is incomplete.
  - removed an unused variable.
* lib/PFTools/Conf.pm:
  - in Init_SUBST(): comment the hostname regexp.
*  lib/PFTools/Net.pm:
  - also export cmpif() and Host_class().
  - corrected a few typos in error messages, and a few indentation cases.
  - don't force bonding interfaces names to start with "bond" this also
    allows vlan tagging on bond interfaces).
* lib/PFTools/Update.pm:
  - also export CVS_update().
* tools/kvmlaunch:
  - new script.

Modified:
    trunk/debian/changelog
    trunk/debian/control
    trunk/filters/filter_distrib
    trunk/lib/PFTools/Conf.pm
    trunk/lib/PFTools/Net.pm
    trunk/lib/PFTools/Update.pm

Modified: trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pf-tools/trunk/debian/changelog?rev=704&op=diff
==============================================================================
--- trunk/debian/changelog (original)
+++ trunk/debian/changelog Wed Mar 18 15:27:29 2009
@@ -1,5 +1,6 @@
 pf-tools (0.34.0-0WIP) unstable; urgency=low
 
+  [ Christophe Caillet ]
   * Factorizing code for Get_Active_Filename in Net.pm with Get_PXE_Filename
   * Forward port commit 635 from 0.33-stable branch
   * Forward port commit 638 from 0.33-stable branch 
@@ -30,7 +31,27 @@
     integrate those functions into Update.pm
   * Integration of PFTools::Packages into Update.pm (need testing)
 
- -- Christophe Caillet <quadchris at free.fr>  Tue, 10 Feb 2009 16:34:07 +0100
+  [ Thomas Parmelan ]
+  * debian/control
+    - added myself as uploder to please dch
+    - pf-host: depends: libdigest-crc-perl
+  * filters/filter_distrib:
+    - exit with a proper error message if the specified host does not exist or
+      its configuration is incomplete.
+    - removed an unused variable.
+  * lib/PFTools/Conf.pm:
+    - in Init_SUBST(): comment the hostname regexp.
+  *  lib/PFTools/Net.pm:
+    - also export cmpif() and Host_class().
+    - corrected a few typos in error messages, and a few indentation cases.
+    - don't force bonding interfaces names to start with "bond" this also
+      allows vlan tagging on bond interfaces).
+  * lib/PFTools/Update.pm:
+    - also export CVS_update().
+  * tools/kvmlaunch:
+    - new script.
+
+ -- Christophe Caillet <tof at sitadelle.com>  Wed, 18 Mar 2009 16:12:13 +0100
 
 pf-tools (0.33.1-1) unstable; urgency=low
 

Modified: trunk/debian/control
URL: http://svn.debian.org/wsvn/pf-tools/trunk/debian/control?rev=704&op=diff
==============================================================================
--- trunk/debian/control (original)
+++ trunk/debian/control Wed Mar 18 15:27:29 2009
@@ -2,6 +2,7 @@
 Section: perl
 Priority: optional
 Maintainer: Damien Clermonte <damien at sitadelle.com>
+Uploaders: Thomas Parmelan <tom+pf-tools at ankh.fr.EU.org>
 Build-Depends-Indep: perl
 Standards-Version: 3.0.1
 
@@ -15,7 +16,7 @@
 
 Package: pf-host
 Architecture: all
-Depends: perl, libmd5-perl, libexpect-perl, libnetwork-ipv4addr-perl, cvs, ssh, iproute, debconf, psmisc, vlan, bridge-utils, uml-utilities, screen, pf-tools (>= 0.30-1), sitalibs-config-perl (>= 0.7.2), libnet-ip-perl
+Depends: perl, libmd5-perl, libdigest-crc-perl, libexpect-perl, libnetwork-ipv4addr-perl, cvs, ssh, iproute, debconf, psmisc, vlan, bridge-utils, uml-utilities, screen, pf-tools (>= 0.30-1), sitalibs-config-perl (>= 0.7.2), libnet-ip-perl
 Description: Outils de gestion d'une plateforme, partie host 
  Deploiement de machines virtuelles UML.
 

Modified: trunk/filters/filter_distrib
URL: http://svn.debian.org/wsvn/pf-tools/trunk/filters/filter_distrib?rev=704&op=diff
==============================================================================
--- trunk/filters/filter_distrib (original)
+++ trunk/filters/filter_distrib Wed Mar 18 15:27:29 2009
@@ -59,11 +59,32 @@
 	exit 1 ;
 }
 
-my $PF_NET		= Init_lib_net( Get_source("GLOBAL:private-network") ) ;
-my $hosttype		= $SUBST{'HOSTTYPE'} ;
-my $host_distrib	= $PF_NET->{'SERVERS'}->{'BY_NAME'}->{$hosttype}->{'SRVLIST'}->{$host}->{'distrib'} ;
-my $host_distsrc	= $PF_NET->{'SERVERS'}->{'BY_NAME'}->{$hosttype}->{'SRVLIST'}->{$host}->{'deploymode'} ;
-$host_distsrc		=~ s/^(debian|ubuntu)-installer$/$1/ ;
+my $PF_NET = Init_lib_net( Get_source("GLOBAL:private-network") );
+
+Init_SUBST( \%SUBST, $host, 'private' ); # does an Abort if $host is not parsable
+
+my $host_type = $SUBST{'HOSTTYPE'};
+
+unless ($PF_NET->{'SERVERS'}->{'BY_NAME'}->{$host_type}) {
+    die "FATAL: unable to find config for host type $host_type";
+}
+
+unless ($PF_NET->{'SERVERS'}->{'BY_NAME'}->{$host_type}->{'SRVLIST'}->{$host}) {
+    die "FATAL: unable to find config for host $host";
+}
+
+my ($host_distrib, $host_distsrc) =
+    @{ $PF_NET->{'SERVERS'}->{'BY_NAME'}->{$host_type}->{'SRVLIST'}->{$host} }{ qw(distrib deploymode) };
+
+unless ($host_distrib) {
+    die "FATAL: unable do find distrib for host $host";
+}
+
+unless ($host_distsrc) {
+    die "FATAL: unable do find deploymode for host $host";
+}
+
+$host_distsrc =~ s/^(debian|ubuntu)-installer$/$1/;
 
 open SRC, "<$src" or die "open: $src: $!\n";
 open DST, ">$dst" or die "open: $dst: $!\n";

Modified: trunk/lib/PFTools/Conf.pm
URL: http://svn.debian.org/wsvn/pf-tools/trunk/lib/PFTools/Conf.pm?rev=704&op=diff
==============================================================================
--- trunk/lib/PFTools/Conf.pm (original)
+++ trunk/lib/PFTools/Conf.pm Wed Mar 18 15:27:29 2009
@@ -92,7 +92,27 @@
 		}
 	}
 	chomp ( $ref_subst->{'OS_RELEASE'} = `/bin/uname -r` ) ;
-	$ref_subst->{'HOSTNAME'}	=~ m/^((([a-z]{3}[\d]{1})-)?([a-z\-0-9]+[a-z\-]))([\d]*)([a-z]*)$/ ;
+	my $host_regex = qr{
+	    \A
+	    (				# HOSTTYPE
+		(
+		    (			# POPNAME (optional)
+			[a-z]{3}\d{1}
+		    )
+		    -
+		)?
+		(
+		    [a-z0-9-]+[a-z-]	# host type (without the POP name)
+		)
+	    )
+	    (\d*)			# HOSTDIGITS (optional)
+	    ([a-z]*)			# HOSTNODEINDEX (optional)
+	    \z
+	}xms;
++
++	unless ($ref_subst->{'HOSTNAME'} =~ m/$host_regex/) {
++	    Abort( $ERR_OPEN, "Init_SUBST failed: invalid hostname $ref_subst->{'HOSTNAME'}" );
++	}
 	$ref_subst->{'HOSTTYPE'}	= $1 ;
 	$ref_subst->{'HOSTDIGITS'}	= $5 ;
 	$ref_subst->{'HOSTCLUSTER'}	= $4.$5 ;

Modified: trunk/lib/PFTools/Net.pm
URL: http://svn.debian.org/wsvn/pf-tools/trunk/lib/PFTools/Net.pm?rev=704&op=diff
==============================================================================
--- trunk/lib/PFTools/Net.pm (original)
+++ trunk/lib/PFTools/Net.pm Wed Mar 18 15:27:29 2009
@@ -51,6 +51,9 @@
     Mk_zone
     Parse_routing_table
     Cmp_routing_table
+    
+    cmpif
+    Host_class
 );
 
 our @EXPORT_OK = qw();
@@ -1650,8 +1653,11 @@
 	$net =~ s/^[^\.]+\.//;
 	my $NET = $Z->{'NETWORK'}->{'BY_NAME'}->{$net};
 
-	if ( $M->{'ifup'}->{$nam} =~ /^bond/ ) {
-		print "\tslaves          ".join ( " ", @{$M->{'bonding'}->{$M->{'ifup'}->{$nam}}} )."\n" ;
+	if ( $M->{'bonding'}->{ $M->{'ifup'}->{$nam} } ) {
+	    print
+		"\tslaves          ",
+		join ( " ", @{$M->{'bonding'}->{$M->{'ifup'}->{$nam}}} ),
+		"\n" ;
 	}
 
 	if ($resolve) {
@@ -1765,11 +1771,11 @@
 	}
 
 	if ( !$mediaerror ) {
-	    my $ifname = $M->{ifup}->{$nam};
+	    my $ifname = $M->{'ifup'}->{$nam};
 	    if ( $ifname =~ m/^([^:.]+)\.(\d+)(:\d+)?$/ ) {
 		$ifname = $1;
 	    }
-	    unless ( $ifname =~ /^bond/ ) {
+	    unless ( $M->{'bonding'}->{$ifname} ) {
 		print "\tup              ethtool -s " 
 		. $ifname . " "
 		. $defaultmedia

Modified: trunk/lib/PFTools/Update.pm
URL: http://svn.debian.org/wsvn/pf-tools/trunk/lib/PFTools/Update.pm?rev=704&op=diff
==============================================================================
--- trunk/lib/PFTools/Update.pm (original)
+++ trunk/lib/PFTools/Update.pm Wed Mar 18 15:27:29 2009
@@ -34,9 +34,10 @@
     $ERR_OPEN
     $ERR_SYNTAX
 
-    Get_source
+    CVS_update
     dirname
     Do_update
+    Get_source
 );
 
 our @EXPORT_OK = qw();




More information about the pf-tools-commits mailing list