]> git.proxmox.com Git - pve-network.git/commitdiff
api: vnet: fix warning in vnet API
authorStefan Hanreich <s.hanreich@proxmox.com>
Mon, 27 Nov 2023 10:23:35 +0000 (11:23 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 29 Nov 2023 09:54:37 +0000 (10:54 +0100)
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 <s.hanreich@proxmox.com>
src/PVE/API2/Network/SDN/Vnets.pm

index 57de29508dbfa9dab309cd4886175d0e3166a6a3..05915f691916125a2279e805303828a5881e4240 100644 (file)
@@ -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;