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 53E289A12A for ; Fri, 17 Nov 2023 11:11:38 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 309811F7F7 for ; Fri, 17 Nov 2023 11:11:08 +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 ; Fri, 17 Nov 2023 11:11:07 +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 401B243D7B for ; Fri, 17 Nov 2023 11:11:07 +0100 (CET) Date: Fri, 17 Nov 2023 11:11:06 +0100 From: Christoph Heiss To: Thomas Lamprecht Cc: Proxmox VE development discussion , Stoiko Ivanov Message-ID: References: <20231116195947.1538515-1-s.ivanov@proxmox.com> <047d4783-d5e2-48fd-8b63-8bf25a6a7383@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <047d4783-d5e2-48fd-8b63-8bf25a6a7383@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL -2.514 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_SOMETLD_ARE_BAD_TLD 5 .bar, .beauty, .buzz, .cam, .casa, .cfd, .club, .date, .guru, .link, .live, .monster, .online, .press, .pw, .quest, .rest, .sbs, .shop, .stream, .top, .trade, .wiki, .work, .xyz TLD abuse SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pve-devel] applied: [PATCH installer] run env: do not store emtpy hostname 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: Fri, 17 Nov 2023 10:11:38 -0000 On Fri, Nov 17, 2023 at 06:37:08AM +0100, Thomas Lamprecht wrote: > > Am 16/11/2023 um 20:59 schrieb Stoiko Ivanov: > > without this patch the hostname ends up as the empty string in > > run-env-info.json, which results in a parse-error in the TUI code > > (an empty string is not None, but still too short as hostname) > > > > Minimally tested on a VM. > > > > Fixes: bda1cdf699a3fcfc1cf3cfa446b1493689fc8eb8 > > Signed-off-by: Stoiko Ivanov > > --- > > Proxmox/Install/RunEnv.pm | 4 +++- > > Proxmox/Sys/Net.pm | 2 +- > > 2 files changed, 4 insertions(+), 2 deletions(-) > > > > > > applied, with some code/naming (style) clean up done in a follow-up, thanks! > > E.g., the method is now named get_dhcp_fqdn, as it doesn't parses out the > first part (sometimes also just named hostname) anymore, but rather passes > along the full FQDN, be it just the local part or a full host.domain one. > > @christoph: please give this another sanity check. One thing - and why this only took the actual hostname in the first place - was that if the DHCP `host-name` is indeed fully-qualified and `domain-name` is set too (which is allowed by the spec), we end up with a duplicate domain name. E.g. if the DHCP server sends `host-name` => "foo.bar" `domain-name` => "bar" would show up in the network setup screen in both UIs as "foo.bar.bar" as the hostname/FQDN. (Tested this case just now FWIW) Not breaking, but I'll send a follow-up patch to strip out the domain-name from the FQDN hostname as needed. Other than that; LGTM.