summaryrefslogtreecommitdiff
path: root/PVE/API2/Network/SDN/Zones.pm
diff options
context:
space:
mode:
authorAlexandre Derumier <aderumier@odiso.com>2020-04-13 08:13:11 +0200
committerThomas Lamprecht <t.lamprecht@proxmox.com>2020-05-02 19:14:58 +0200
commitf9bc9640820074d770aedb8a0e431e5c69bae3c1 (patch)
tree49a9cf18cc208f12115ad54fbb3b630a76503a8e /PVE/API2/Network/SDN/Zones.pm
parentf703d2ae09b7f877c5afa23d1109426b83ed3b69 (diff)
sdn: use .version and global lock
Diffstat (limited to 'PVE/API2/Network/SDN/Zones.pm')
-rw-r--r--PVE/API2/Network/SDN/Zones.pm13
1 files changed, 10 insertions, 3 deletions
diff --git a/PVE/API2/Network/SDN/Zones.pm b/PVE/API2/Network/SDN/Zones.pm
index 9ea2189..3201b10 100644
--- a/PVE/API2/Network/SDN/Zones.pm
+++ b/PVE/API2/Network/SDN/Zones.pm
@@ -6,6 +6,7 @@ use warnings;
use PVE::SafeSyslog;
use PVE::Tools qw(extract_param);
use PVE::Cluster qw(cfs_read_file cfs_write_file);
+use PVE::Network::SDN;
use PVE::Network::SDN::Vnets;
use PVE::Network::SDN::Zones;
use PVE::Network::SDN::Zones::Plugin;
@@ -143,7 +144,7 @@ __PACKAGE__->register_method ({
PVE::Cluster::check_cfs_quorum();
mkdir("/etc/pve/sdn");
- PVE::Network::SDN::Zones::lock_sdn_zones_config(
+ PVE::Network::SDN::lock_sdn_config(
sub {
my $zone_cfg = PVE::Network::SDN::Zones::config();
@@ -159,6 +160,8 @@ __PACKAGE__->register_method ({
PVE::Network::SDN::Zones::write_config($zone_cfg);
+ PVE::Network::SDN::increase_version();
+
}, "create sdn zone object failed");
return undef;
@@ -181,7 +184,7 @@ __PACKAGE__->register_method ({
my $id = extract_param($param, 'zone');
my $digest = extract_param($param, 'digest');
- PVE::Network::SDN::Zones::lock_sdn_zones_config(
+ PVE::Network::SDN::lock_sdn_config(
sub {
my $zone_cfg = PVE::Network::SDN::Zones::config();
@@ -202,6 +205,8 @@ __PACKAGE__->register_method ({
PVE::Network::SDN::Zones::write_config($zone_cfg);
+ PVE::Network::SDN::increase_version();
+
}, "update sdn zone object failed");
return undef;
@@ -230,7 +235,7 @@ __PACKAGE__->register_method ({
my $id = extract_param($param, 'zone');
- PVE::Network::SDN::Zones::lock_sdn_zones_config(
+ PVE::Network::SDN::lock_sdn_config(
sub {
my $cfg = PVE::Network::SDN::Zones::config();
@@ -246,6 +251,8 @@ __PACKAGE__->register_method ({
delete $cfg->{ids}->{$id};
PVE::Network::SDN::Zones::write_config($cfg);
+ PVE::Network::SDN::increase_version();
+
}, "delete sdn zone object failed");