]> git.proxmox.com Git - pve-installer.git/commitdiff
config: avoid warning if no country was detected
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 21 Jun 2023 08:45:28 +0000 (10:45 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 21 Jun 2023 08:45:31 +0000 (10:45 +0200)
e.g., due to having no network (no DHCP lease)

Reported-by: Christian Ebner <c.ebner@proxmox.com>
Reported-by: Stefan Hanreich <s.hanreich@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Proxmox/Install/Config.pm

index 6916f257c670ebefd54440b9194e4579ff8f5060..024f62a008dcb44835e7c1289d0ae4551d5d8221 100644 (file)
@@ -51,7 +51,7 @@ my sub init_cfg {
     my $iso_env = Proxmox::Install::ISOEnv::get();
 
     my $country = Proxmox::Install::RunEnv::get('country');
-    if (!defined($iso_env->{locales}->{country}->{$country})) {
+    if (defined($country) && !defined($iso_env->{locales}->{country}->{$country})) {
        log_warn("ignoring detected country '$country', invalid or unknown\n");
        $country = undef;
     }