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 7D9701FF185 for ; Mon, 4 Aug 2025 15:45:41 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9FFC431F3A; Mon, 4 Aug 2025 15:47:09 +0200 (CEST) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Date: Mon, 4 Aug 2025 15:47:03 +0200 Message-ID: <20250804134706.408039-2-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250804134706.408039-1-s.hanreich@proxmox.com> References: <20250804134706.408039-1-s.hanreich@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.192 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 KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Subject: [pve-devel] [PATCH pve-manager 1/1] api: network: default to not regenerating the frr configuration 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: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Default to not regenerating the FRR configuration, unless explicitly requested. Otherwise applying the host network configuration would reload and enable the FRR service. Invert the boolean from skip to regenerate, since the logic is less convoluted this way. Signed-off-by: Stefan Hanreich --- PVE/API2/Network.pm | 7 ++++--- bin/pve-sdn-commit | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/PVE/API2/Network.pm b/PVE/API2/Network.pm index 93f441bab..b423e19b5 100644 --- a/PVE/API2/Network.pm +++ b/PVE/API2/Network.pm @@ -891,10 +891,11 @@ __PACKAGE__->register_method({ additionalProperties => 0, properties => { node => get_standard_option('pve-node'), - skip_frr => { + 'regenerate-frr' => { type => 'boolean', description => 'Whether FRR config generation should get skipped or not.', optional => 1, + default => 0, }, }, }, @@ -910,7 +911,7 @@ __PACKAGE__->register_method({ my $current_config_file = "/etc/network/interfaces"; my $new_config_file = "/etc/network/interfaces.new"; - my $skip_frr = extract_param($param, 'skip_frr'); + my $regenerate_frr = extract_param($param, 'regenerate-frr'); assert_ifupdown2_installed(); @@ -931,7 +932,7 @@ __PACKAGE__->register_method({ }; PVE::Tools::run_command(['ifreload', '-a'], errfunc => $err); - if ($have_sdn && !$skip_frr) { + if ($have_sdn && $regenerate_frr) { PVE::Network::SDN::generate_frr_config(1); } }; diff --git a/bin/pve-sdn-commit b/bin/pve-sdn-commit index 492963baf..6eeba301c 100644 --- a/bin/pve-sdn-commit +++ b/bin/pve-sdn-commit @@ -83,7 +83,7 @@ my $previous_config_has_frr = PVE::Network::SDN::running_config_has_frr(); PVE::Network::SDN::commit_config(); my $new_config_has_frr = PVE::Network::SDN::running_config_has_frr(); -my $skip_frr = !($previous_config_has_frr || $new_config_has_frr); +my $regenerate_frr = ($previous_config_has_frr || $new_config_has_frr); PVE::Network::SDN::generate_etc_network_config(); PVE::Network::SDN::generate_dhcp_config(); @@ -97,6 +97,6 @@ my $err = sub { PVE::Tools::run_command(['ifreload', '-a'], errfunc => $err); -PVE::Network::SDN::generate_frr_config(1) if !$skip_frr; +PVE::Network::SDN::generate_frr_config(1) if $regenerate_frr; exit 0; -- 2.47.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel