]> git.proxmox.com Git - pve-firewall.git/blobdiff - src/PVE/API2/Firewall/Cluster.pm
cleanup makefiles, set target dirs per makefile
[pve-firewall.git] / src / PVE / API2 / Firewall / Cluster.pm
index b924f4edc22de2250b3db3c7a4e3aa215ce83f04..eee6d191f3ae64a135b9a853363b3d0b98475e6b 100644 (file)
@@ -71,25 +71,7 @@ __PACKAGE__->register_method({
        return $result;
     }});
 
-my $option_properties = {
-    enable => {
-       type => 'integer',
-       minimum => 0,
-       optional => 1,
-    },
-    policy_in => {
-       description => "Input policy.",
-       type => 'string',
-       optional => 1,
-       enum => ['ACCEPT', 'REJECT', 'DROP'],
-    },
-    policy_out => {
-       description => "Output policy.",
-       type => 'string',
-       optional => 1,
-       enum => ['ACCEPT', 'REJECT', 'DROP'],
-    },
-};
+my $option_properties = $PVE::Firewall::cluster_option_properties;
 
 my $add_option_properties = sub {
     my ($properties) = @_;
@@ -175,6 +157,12 @@ __PACKAGE__->register_method({
 
        PVE::Firewall::save_clusterfw_conf($cluster_conf);
 
+       # 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;
     }});