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 EE0C0BB7CC for ; Mon, 25 Mar 2024 14:20:48 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D03294B60 for ; Mon, 25 Mar 2024 14:20:18 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (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 firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 25 Mar 2024 14:20:18 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id E32E741F11 for ; Mon, 25 Mar 2024 14:20:17 +0100 (CET) Content-Type: text/plain; charset=UTF-8 Date: Mon, 25 Mar 2024 14:20:17 +0100 Message-Id: From: "Max Carrara" To: "Proxmox VE development discussion" Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: aerc 0.17.0-72-g6a84f1331f1c References: <20240307151319.301984-2-s.lendl@proxmox.com> <20240307151319.301984-4-s.lendl@proxmox.com> In-Reply-To: <20240307151319.301984-4-s.lendl@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.021 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 Subject: Re: [pve-devel] [PATCH v2 pve-network 2/5] refactor(evpn): extract read_local_frr_config 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: Mon, 25 Mar 2024 13:20:49 -0000 Should just be "evpn: [...]" as per our commit guidelines [0], but this can honestly be changed while applying. Otherwise LGTM! [0]: https://pve.proxmox.com/wiki/Developer_Documentation#Commits_and_Commi= t_Messages On Thu Mar 7, 2024 at 4:13 PM CET, Stefan Lendl wrote: > to allow mocking local fs access > > Signed-off-by: Stefan Lendl > --- > src/PVE/Network/SDN/Controllers/EvpnPlugin.pm | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/src/PVE/Netw= ork/SDN/Controllers/EvpnPlugin.pm > index c2fdf88..836a689 100644 > --- a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm > +++ b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm > @@ -487,6 +487,12 @@ sub generate_frr_list { > } > } > =20 > +sub read_local_frr_config { > + if (-e "/etc/frr/frr.conf.local") { > + return file_get_contents("/etc/frr/frr.conf.local"); > + } > +}; > + > sub generate_controller_rawconfig { > my ($class, $plugin_config, $config) =3D @_; > =20 > @@ -500,8 +506,8 @@ sub generate_controller_rawconfig { > push @{$final_config}, "service integrated-vtysh-config"; > push @{$final_config}, "!"; > =20 > - if (-e "/etc/frr/frr.conf.local") { > - my $local_conf =3D file_get_contents("/etc/frr/frr.conf.local"); > + my $local_conf =3D read_local_frr_config(); > + if ($local_conf) { > parse_merge_frr_local_config($config, $local_conf); > } > =20