From af83df01a8a955bb18d144893f3f6197219c9bda Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 18 Nov 2024 20:46:34 +0100 Subject: [PATCH] ovf import: guest name: normalize whitespace to minus This is nicer from a readability POV, but replace a arbitrary amount of whitespace by a single minus character to avoid making it look odd. Signed-off-by: Thomas Lamprecht --- src/PVE/GuestImport/OVF.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PVE/GuestImport/OVF.pm b/src/PVE/GuestImport/OVF.pm index 9e9f8b3..264ee6f 100644 --- a/src/PVE/GuestImport/OVF.pm +++ b/src/PVE/GuestImport/OVF.pm @@ -209,6 +209,7 @@ sub parse_ovf { if ($ovf_name) { # PVE::QemuServer::confdesc requires a valid DNS name + $ovf_name =~ s/\s+/-/g; ($qm->{name} = $ovf_name) =~ s/[^a-zA-Z0-9\-\.]//g; } else { warn "warning: unable to parse the VM name in this OVF manifest, generating a default value\n";