From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id EA9871FF13C for ; Thu, 28 May 2026 15:39:58 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6C90E1E084; Thu, 28 May 2026 15:39:58 +0200 (CEST) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Subject: [PATCH pve-network 1/1] api2: evpn status: properly handle nodes field of evpn zones Date: Thu, 28 May 2026 15:39:46 +0200 Message-ID: <20260528133947.309145-1-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1779975566270 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.599 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: HKTMHP4XS3VTHKK4JXNCKVHT66RF3YZF X-Message-ID-Hash: HKTMHP4XS3VTHKK4JXNCKVHT66RF3YZF X-MailFrom: s.hanreich@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: When querying the status of EVPN IP/MAC-VRFs, the nodes field of the zone configuration is read. The nodes are returned as a dictionary, but the API endpoints are treating the field as an array. This leads to an error when trying to obtain the status of an EVPN zone with nodes configured explicitly: Not an ARRAY reference at /usr/share/perl5/PVE/API2/Network/SDN/Nodes/Zone.pm line 379. or Not an ARRAY reference at /usr/share/perl5/PVE/API2/Network/SDN/Nodes/Vnet.pm line 141. This has been reported by a user in the forum [1]. [1] https://forum.proxmox.com/threads/sdn-evpn-ip-vrf-and-mac-vrf-panels-are-empty-but-vtysh-shows-correct-routes.183897/ Signed-off-by: Stefan Hanreich --- src/PVE/API2/Network/SDN/Nodes/Vnet.pm | 2 +- src/PVE/API2/Network/SDN/Nodes/Zone.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PVE/API2/Network/SDN/Nodes/Vnet.pm b/src/PVE/API2/Network/SDN/Nodes/Vnet.pm index d5dae56b..8cbf1e5e 100644 --- a/src/PVE/API2/Network/SDN/Nodes/Vnet.pm +++ b/src/PVE/API2/Network/SDN/Nodes/Vnet.pm @@ -138,7 +138,7 @@ __PACKAGE__->register_method({ raise_param_exc({ zone => "zone $vnet->{zone} of vnet $vnet_id does not exist on node $node_id", }) - if defined($zone->{nodes}) && !grep { $_ eq $node_id } $zone->{nodes}->@*; + if defined($zone->{nodes}) && !$zone->{nodes}->{$node_id}; return PVE::RS::SDN::Fabrics::l2vpn_routes($vnet_id); }, diff --git a/src/PVE/API2/Network/SDN/Nodes/Zone.pm b/src/PVE/API2/Network/SDN/Nodes/Zone.pm index c1e48da7..a4e72c50 100644 --- a/src/PVE/API2/Network/SDN/Nodes/Zone.pm +++ b/src/PVE/API2/Network/SDN/Nodes/Zone.pm @@ -376,7 +376,7 @@ __PACKAGE__->register_method({ raise_param_exc({ zone => "zone does not exist on node $node_id", }) - if defined($zone->{nodes}) && !grep { $_ eq $node_id } $zone->{nodes}->@*; + if defined($zone->{nodes}) && !$zone->{nodes}->{$node_id}; return PVE::RS::SDN::Fabrics::l3vpn_routes($zone_id); }, -- 2.47.3