pf-tools commit: r863 [ccaillet-guest] - in /branches/next-gen/lib/PFTools: Conf/Syntax.pm Update/Common.pm Utils.pm
parmelan-guest at users.alioth.debian.org
parmelan-guest at users.alioth.debian.org
Mon Aug 30 11:39:55 UTC 2010
Author: ccaillet-guest
Date: Mon Aug 30 11:39:51 2010
New Revision: 863
URL: http://svn.debian.org/wsvn/pf-tools/?sc=1&rev=863
Log:
WIP: adding some code for handling grouped actions with actiongroup directive
Modified:
branches/next-gen/lib/PFTools/Conf/Syntax.pm
branches/next-gen/lib/PFTools/Update/Common.pm
branches/next-gen/lib/PFTools/Utils.pm
Modified: branches/next-gen/lib/PFTools/Conf/Syntax.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Conf/Syntax.pm?rev=863&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Conf/Syntax.pm (original)
+++ branches/next-gen/lib/PFTools/Conf/Syntax.pm Mon Aug 30 11:39:51 2010
@@ -280,7 +280,7 @@
'MANDATORY_KEYS' => [ 'filter' ],
'filter' => 'undefined'
},
- 'group' => {
+ 'actiongroup' => {
'on_config' => 'undefined',
'before_change' => 'undefined',
'on_noaction' => 'undefined',
Modified: branches/next-gen/lib/PFTools/Update/Common.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Update/Common.pm?rev=863&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Update/Common.pm (original)
+++ branches/next-gen/lib/PFTools/Update/Common.pm Mon Aug 30 11:39:51 2010
@@ -197,6 +197,10 @@
sub Do_on_config ($$$) {
my ( $ref_section, $options, $hash_subst ) = @_;
+ if ( $ref_section->{'actiongroup'} ) {
+ Log ( "Triggering actiongroup ".$ref_section->{'actiongroup'} ) if ( $options->{'verbose'} );
+ return 0;
+ }
if ( ! $options->{'simul'}
&& defined ( $ref_section->{'on_config'} )
) {
@@ -207,6 +211,10 @@
sub Do_before_change ($$$) {
my ( $ref_section, $options, $hash_subst ) = @_;
+ if ( $ref_section->{'actiongroup'} ) {
+ Log ( "Triggering actiongroup ".$ref_section->{'actiongroup'} ) if ( $options->{'verbose'} );
+ return 0;
+ }
if ( ! $options->{'simul'}
&& ! $options->{'noaction'}
&& defined ( $ref_section->{'before_change'} )
@@ -218,6 +226,10 @@
sub Do_after_change ($$$) {
my ( $ref_section, $options, $hash_subst ) = @_;
+ if ( $ref_section->{'actiongroup'} ) {
+ Log ( "Triggering actiongroup ".$ref_section->{'actiongroup'} ) if ( $options->{'verbose'} );
+ return 0;
+ }
if ( !$options->{'simul'}
&& defined ( $ref_section->{'after_change'} )
&& !$options->{'noaction'}
@@ -229,6 +241,10 @@
sub Do_on_noaction ($$$) {
my ( $ref_section, $options, $hash_subst ) = @_;
+ if ( $ref_section->{'actiongroup'} ) {
+ Log ( "Triggering actiongroup ".$ref_section->{'actiongroup'} ) if ( $options->{'verbose'} );
+ return 0;
+ }
if ( ! $options->{'simul'}
&& defined ( $ref_section->{'on_noaction'} )
&& $options->{'noaction'}
Modified: branches/next-gen/lib/PFTools/Utils.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Utils.pm?rev=863&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Utils.pm (original)
+++ branches/next-gen/lib/PFTools/Utils.pm Mon Aug 30 11:39:51 2010
@@ -798,6 +798,14 @@
my $errorcount = 0;
foreach my $section (@{$sortedkeys}) {
+ next if ( $host_config->{$section}->{'action'} eq 'actiongroup' );
+# if (
+# $host_config->{$section}->{'actiongroup'}
+# && ! defined $host_config->{$host_config->{$section}->{'actiongroup'}}
+# ) {
+# Abort ( $CODE->{'UNDEF_KEY'},
+# "Unable to trigger an actiongroup which is not defined into configuration" );
+# }
if (
! defined( $host_config->{$section}->{'doing'} )
&& ! defined( $host_config->{$section}->{'done'} )
More information about the pf-tools-commits
mailing list