From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id A90B363379 for ; Wed, 15 Jul 2020 15:03:19 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 91D0B2FEA0 for ; Wed, 15 Jul 2020 15:02:49 +0200 (CEST) Received: from mailpro.odiso.net (mailpro.odiso.net [89.248.211.110]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id CE3572FDDA for ; Wed, 15 Jul 2020 15:02:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mailpro.odiso.net (Postfix) with ESMTP id 492911351CE2; Wed, 15 Jul 2020 15:02:38 +0200 (CEST) Received: from mailpro.odiso.net ([127.0.0.1]) by localhost (mailpro.odiso.net [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id TB4Aq_bC4viU; Wed, 15 Jul 2020 15:02:38 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mailpro.odiso.net (Postfix) with ESMTP id 3141C1351CE6; Wed, 15 Jul 2020 15:02:38 +0200 (CEST) X-Virus-Scanned: amavisd-new at mailpro.odiso.com Received: from mailpro.odiso.net ([127.0.0.1]) by localhost (mailpro.odiso.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id hTmR9S2oTLR3; Wed, 15 Jul 2020 15:02:38 +0200 (CEST) Received: from pve.fritz.box (unknown [213.211.148.86]) by mailpro.odiso.net (Postfix) with ESMTPSA id 0083B1351CE2; Wed, 15 Jul 2020 15:02:37 +0200 (CEST) From: Alexandre Derumier To: pve-devel@pve.proxmox.com Date: Wed, 15 Jul 2020 15:02:30 +0200 Message-Id: <20200715130231.21518-10-aderumier@odiso.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200715130231.21518-1-aderumier@odiso.com> References: <20200715130231.21518-1-aderumier@odiso.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [vnets.pm, sdn.pm, subnets.pm, zones.pm, controllers.pm] Subject: [pve-devel] [PATCH v2 pve-network 09/10] api2: increase version on apply/reload only X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jul 2020 13:03:19 -0000 Signed-off-by: Alexandre Derumier --- PVE/API2/Network/SDN.pm | 3 +++ PVE/API2/Network/SDN/Controllers.pm | 6 ------ PVE/API2/Network/SDN/Subnets.pm | 3 --- PVE/API2/Network/SDN/Vnets.pm | 3 --- PVE/API2/Network/SDN/Zones.pm | 6 ------ 5 files changed, 3 insertions(+), 18 deletions(-) diff --git a/PVE/API2/Network/SDN.pm b/PVE/API2/Network/SDN.pm index 38af746..175f76f 100644 --- a/PVE/API2/Network/SDN.pm +++ b/PVE/API2/Network/SDN.pm @@ -10,6 +10,7 @@ use PVE::RESTHandler; use PVE::RPCEnvironment; use PVE::SafeSyslog; use PVE::Tools qw(run_command); +use PVE::Network::SDN; =20 use PVE::API2::Network::SDN::Controllers; use PVE::API2::Network::SDN::Vnets; @@ -111,6 +112,8 @@ __PACKAGE__->register_method ({ my $rpcenv =3D PVE::RPCEnvironment::get(); my $authuser =3D $rpcenv->get_user(); =20 + PVE::Network::SDN::increase_version(); + my $code =3D sub { $rpcenv->{type} =3D 'priv'; # to start tasks in background PVE::Cluster::check_cfs_quorum(); diff --git a/PVE/API2/Network/SDN/Controllers.pm b/PVE/API2/Network/SDN/C= ontrollers.pm index 9bc3075..919d343 100644 --- a/PVE/API2/Network/SDN/Controllers.pm +++ b/PVE/API2/Network/SDN/Controllers.pm @@ -152,8 +152,6 @@ __PACKAGE__->register_method ({ =20 PVE::Network::SDN::Controllers::write_config($controller_cfg); =20 - PVE::Network::SDN::increase_version(); - }, "create sdn controller object failed"); =20 return undef; @@ -196,8 +194,6 @@ __PACKAGE__->register_method ({ =20 PVE::Network::SDN::Controllers::write_config($controller_cfg); =20 - PVE::Network::SDN::increase_version(); - =20 }, "update sdn controller object failed"); =20 @@ -243,8 +239,6 @@ __PACKAGE__->register_method ({ delete $cfg->{ids}->{$id}; PVE::Network::SDN::Controllers::write_config($cfg); =20 - PVE::Network::SDN::increase_version(); - }, "delete sdn controller object failed"); =20 =20 diff --git a/PVE/API2/Network/SDN/Subnets.pm b/PVE/API2/Network/SDN/Subne= ts.pm index d18cf90..d9cb9e9 100644 --- a/PVE/API2/Network/SDN/Subnets.pm +++ b/PVE/API2/Network/SDN/Subnets.pm @@ -134,7 +134,6 @@ __PACKAGE__->register_method ({ $cfg->{ids}->{$id} =3D $opts; PVE::Network::SDN::SubnetPlugin->on_update_hook($id, $cfg); PVE::Network::SDN::Subnets::write_config($cfg); - PVE::Network::SDN::increase_version(); =20 }, "create sdn subnet object failed"); =20 @@ -170,7 +169,6 @@ __PACKAGE__->register_method ({ =20 PVE::Network::SDN::SubnetPlugin->on_update_hook($id, $cfg); PVE::Network::SDN::Subnets::write_config($cfg); - PVE::Network::SDN::increase_version(); =20 }, "update sdn subnet object failed"); =20 @@ -213,7 +211,6 @@ __PACKAGE__->register_method ({ delete $cfg->{ids}->{$id}; PVE::Network::SDN::SubnetPlugin->on_delete_hook($id, $subnets_cfg, $vn= ets_cfg); PVE::Network::SDN::Subnets::write_config($cfg); - PVE::Network::SDN::increase_version(); =20 }, "delete sdn subnet object failed"); =20 diff --git a/PVE/API2/Network/SDN/Vnets.pm b/PVE/API2/Network/SDN/Vnets.p= m index 58ec21f..b585c9c 100644 --- a/PVE/API2/Network/SDN/Vnets.pm +++ b/PVE/API2/Network/SDN/Vnets.pm @@ -138,7 +138,6 @@ __PACKAGE__->register_method ({ PVE::Network::SDN::VnetPlugin->on_update_hook($id, $cfg, $subnet_cf= g); =20 PVE::Network::SDN::Vnets::write_config($cfg); - PVE::Network::SDN::increase_version(); =20 }, "create sdn vnet object failed"); =20 @@ -181,7 +180,6 @@ __PACKAGE__->register_method ({ PVE::Network::SDN::VnetPlugin->on_update_hook($id, $cfg, $subnet_cf= g); =20 PVE::Network::SDN::Vnets::write_config($cfg); - PVE::Network::SDN::increase_version(); =20 }, "update sdn vnet object failed"); =20 @@ -221,7 +219,6 @@ __PACKAGE__->register_method ({ =20 delete $cfg->{ids}->{$id}; PVE::Network::SDN::Vnets::write_config($cfg); - PVE::Network::SDN::increase_version(); =20 }, "delete sdn vnet object failed"); =20 diff --git a/PVE/API2/Network/SDN/Zones.pm b/PVE/API2/Network/SDN/Zones.p= m index f629f43..a37df3d 100644 --- a/PVE/API2/Network/SDN/Zones.pm +++ b/PVE/API2/Network/SDN/Zones.pm @@ -161,8 +161,6 @@ __PACKAGE__->register_method ({ =20 PVE::Network::SDN::Zones::write_config($zone_cfg); =20 - PVE::Network::SDN::increase_version(); - }, "create sdn zone object failed"); =20 return undef; @@ -206,8 +204,6 @@ __PACKAGE__->register_method ({ =20 PVE::Network::SDN::Zones::write_config($zone_cfg); =20 - PVE::Network::SDN::increase_version(); - }, "update sdn zone object failed"); =20 return undef; @@ -252,8 +248,6 @@ __PACKAGE__->register_method ({ delete $cfg->{ids}->{$id}; PVE::Network::SDN::Zones::write_config($cfg); =20 - PVE::Network::SDN::increase_version(); - }, "delete sdn zone object failed"); =20 =20 --=20 2.20.1