all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH installer] proxinstall: fix empty error message when default hostname is not changed
Date: Tue, 27 Feb 2024 10:33:42 +0100	[thread overview]
Message-ID: <20240227093350.234523-1-c.heiss@proxmox.com> (raw)

Perl strikes again - while an empty string evaluates falsy in Perl, it
is still defined and thus the //-operator cannot be used here.

Fixes: 93892c0 ("proxinstall: avoid open-coding FQDN sanity check")
Reported-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
 proxinstall | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/proxinstall b/proxinstall
index 351b240..d28aeaa 100755
--- a/proxinstall
+++ b/proxinstall
@@ -461,7 +461,8 @@ sub create_ipconf_view {
 	my $err = $@;
 
 	if ($err || $text =~ m/.example.invalid$/) {
-	    Proxmox::UI::message($err // 'Hostname does not look like a valid fully qualified domain name');
+	    $err = 'Hostname does not look like a valid fully qualified domain name' if !$err;
+	    Proxmox::UI::message($err);
 	    $hostentry->grab_focus();
 	    return;
 	} else {
-- 
2.43.0





                 reply	other threads:[~2024-02-27  9:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240227093350.234523-1-c.heiss@proxmox.com \
    --to=c.heiss@proxmox.com \
    --cc=pve-devel@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal