pf-tools commit: r813 [ccaillet-guest] - in /branches/next-gen: lib/PFTools/Utils.pm sbin/update-config
parmelan-guest at users.alioth.debian.org
parmelan-guest at users.alioth.debian.org
Fri Aug 6 12:49:09 UTC 2010
Author: ccaillet-guest
Date: Fri Aug 6 12:48:57 2010
New Revision: 813
URL: http://svn.debian.org/wsvn/pf-tools/?sc=1&rev=813
Log:
Misc fixes and need to test funtions which are called by line 914 and 942 in Utils.pm
Modified:
branches/next-gen/lib/PFTools/Utils.pm
branches/next-gen/sbin/update-config
Modified: branches/next-gen/lib/PFTools/Utils.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Utils.pm?rev=813&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Utils.pm (original)
+++ branches/next-gen/lib/PFTools/Utils.pm Fri Aug 6 12:48:57 2010
@@ -139,6 +139,22 @@
my ( $hostshort, $hostvlan ) = ( $1, $3 ) ;
my $hosttype = Get_hosttype_from_hostname ( $hostname, $global_config );
return $site_part->{'HOST'}->{'BY_NAME'}->{$hosttype}->{$hostshort} ;
+}
+
+sub Get_pkgtype_from_hostname ($$;$) {
+ my ( $hostname, $global_config, $site ) = @_;
+
+ my $host_props = Get_host_config_from_CONFIG ( $hostname, $global_config, $site );
+ return undef if ( ! defined $host_props );
+ my $mode = $host_props->{'deployment'}->{'mode'};
+ if ( $mode =~ /^(debian|ubuntu)$/ ) {
+ return 'deb';
+ }
+ else {
+ Warn ( $CODE->{'UNDEF_KEY'},
+ "Unknown mode ".$mode." of deployment : cannot retrieve package type for this one" );
+ return undef;
+ }
}
#########################################################################
@@ -940,11 +956,19 @@
my ( $hostname, $site, $options, $global_config, $pf_config ) = @_;
my $errorcount = 0;
+ Set_deferredlog ();
if ( ! VCS_update ( $hostname, $pf_config, $options ) ) {
Abort ( $CODE->{'EXEC'},
"Unable to checkout configuration from VCS system" );
}
+ Unset_deferredlog ();
my $hash_subst = Init_SUBST ( $hostname, $pf_config );
+ if ( ! defined $options->{'pkg_type'} ) {
+ unless ( $options->{'pkg_type'} = Get_pkgtype_from_hostname ( $hostname, $global_config, $site ) ) {
+ Abort ( $CODE->{'INVALID_VALUE'},
+ "Unable to retrieve package type from hostname ".$hostname );
+ }
+ }
my $host_config = Get_config_for_hostname_on_site ( $hostname, $site, $hash_subst, $global_config, $pf_config );
if ( ! defined $host_config ) {
Abort( $CODE->{'OPEN'},
Modified: branches/next-gen/sbin/update-config
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/sbin/update-config?rev=813&op=diff
==============================================================================
--- branches/next-gen/sbin/update-config (original)
+++ branches/next-gen/sbin/update-config Fri Aug 6 12:48:57 2010
@@ -59,6 +59,7 @@
-i --install : install mode
-s --simul : simulation mode, fake everything
-v --verbose : be more verbose
+ - --pkg_type : specify the package type default is deb (optional)
--branch : update based on a specific VCS branche.
# ENDHELP
More information about the pf-tools-commits
mailing list