]> git.proxmox.com Git - pve-firewall.git/blobdiff - src/PVE/API2/Firewall/Cluster.pm
improve concurrent update handling
[pve-firewall.git] / src / PVE / API2 / Firewall / Cluster.pm
index 10ad06253949b8c6a9e98411762c994c5e69a5ed..8d575da5e85985d2b75cca6d86629dd91c520752 100644 (file)
@@ -85,9 +85,7 @@ __PACKAGE__->register_method({
 
        my $cluster_conf = PVE::Firewall::load_clusterfw_conf();
 
-       my $options = $cluster_conf->{options};
-
-       return $options;
+       return PVE::Firewall::copy_opject_with_digest($cluster_conf->{options});
     }});
 
 my $option_properties = {
@@ -121,6 +119,7 @@ __PACKAGE__->register_method({
                description => "A list of settings you want to delete.",
                optional => 1,
            },
+           digest => get_standard_option('pve-config-digest'),
        }),
     },
     returns => { type => "null" },
@@ -129,6 +128,9 @@ __PACKAGE__->register_method({
 
        my $cluster_conf = PVE::Firewall::load_clusterfw_conf();
 
+       my (undef, $digest) = PVE::Firewall::copy_opject_with_digest($cluster_conf->{options});
+       PVE::Tools::assert_if_modified($digest, $param->{digest});
+
        if ($param->{delete}) {
            foreach my $opt (PVE::Tools::split_list($param->{delete})) {
                raise_param_exc({ delete => "no such option '$opt'" })