From 2664f295758acc2485f14fc327b8c1abc7149c3f Mon Sep 17 00:00:00 2001 From: Stefan Hanreich Date: Mon, 27 Nov 2023 11:23:35 +0100 Subject: [PATCH] api: vnet: fix warning in vnet API If zone is not set, we also check the pending changes for a zone key, since it is set as pending when the Vnet settings have not yet been applied. Signed-off-by: Stefan Hanreich --- src/PVE/API2/Network/SDN/Vnets.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PVE/API2/Network/SDN/Vnets.pm b/src/PVE/API2/Network/SDN/Vnets.pm index 57de295..05915f6 100644 --- a/src/PVE/API2/Network/SDN/Vnets.pm +++ b/src/PVE/API2/Network/SDN/Vnets.pm @@ -123,7 +123,7 @@ __PACKAGE__->register_method ({ foreach my $id (@sids) { my $privs = [ 'SDN.Audit', 'SDN.Allocate' ]; my $scfg = &$api_sdn_vnets_config($cfg, $id); - my $zoneid = $scfg->{zone}; + my $zoneid = $scfg->{zone} // $scfg->{pending}->{zone}; next if !$rpcenv->check_any($authuser, "/sdn/zones/$zoneid/$id", $privs, 1); push @$res, $scfg; -- 2.39.5