[pve-devel] [PATCH 3/3] firewall instant API call update

Dietmar Maurer dietmar at proxmox.com
Thu Jun 25 17:28:27 CEST 2015


What I wanted is to check the transition from

'enable = 0'  to 'enable > 0'

which triggers when the user turn on firewalling.

you just test it it is 'enable > 1'?

> On June 25, 2015 at 4:57 PM Alen Grizonic <a.grizonic at proxmox.com> wrote:
> 
> 
> Signed-off-by: Alen Grizonic <a.grizonic at proxmox.com>
> ---
>  src/PVE/API2/Firewall/Cluster.pm | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/PVE/API2/Firewall/Cluster.pm
> b/src/PVE/API2/Firewall/Cluster.pm
> index ea51fcc..c4e2b63 100644
> --- a/src/PVE/API2/Firewall/Cluster.pm
> +++ b/src/PVE/API2/Firewall/Cluster.pm
> @@ -175,7 +175,11 @@ __PACKAGE__->register_method({
>  
>  	PVE::Firewall::save_clusterfw_conf($cluster_conf);
>  
> -	PVE::Firewall::update();
> +	# instant firewall update when using double (anti-lockout) API call
> +	# -> not waiting for a firewall update at the first (timestamp enable) set
> +	if (defined($param->{enable}) && ($param->{enable} > 1)) {
> +	    PVE::Firewall::update();
> +	}
>  
>  	return undef;
>      }});
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 




More information about the pve-devel mailing list