public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christoph Heiss <c.heiss@proxmox.com>
To: Thomas Lamprecht <t.lamprecht@proxmox.com>
Cc: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	 Stoiko Ivanov <s.ivanov@proxmox.com>
Subject: Re: [pve-devel] applied: [PATCH installer] run env: do not store emtpy hostname
Date: Fri, 17 Nov 2023 11:11:06 +0100	[thread overview]
Message-ID: <z5raaszvrpg5wnbu4sc57vmt574s3oydodhkhxfpe47bothnfo@usmnozvekxuk> (raw)
In-Reply-To: <047d4783-d5e2-48fd-8b63-8bf25a6a7383@proxmox.com>


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 <s.ivanov@proxmox.com>
> > ---
> >  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.




      reply	other threads:[~2023-11-17 10:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-16 19:59 [pve-devel] " Stoiko Ivanov
2023-11-17  5:37 ` [pve-devel] applied: " Thomas Lamprecht
2023-11-17 10:11   ` Christoph Heiss [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=z5raaszvrpg5wnbu4sc57vmt574s3oydodhkhxfpe47bothnfo@usmnozvekxuk \
    --to=c.heiss@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=s.ivanov@proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal