[pve-devel] [PATCH installer] handle invalid or unknown detected country

Fabian Grünbichler f.gruenbichler at proxmox.com
Fri Jul 28 13:16:56 CEST 2017


Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
as reported on https://forum.proxmox.com/threads/proxmoxve-5-do-not-progress-after-disk-option.35945

 proxinstall | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/proxinstall b/proxinstall
index 21d2005..59c24de 100755
--- a/proxinstall
+++ b/proxinstall
@@ -2377,7 +2377,7 @@ sub create_country_view {
     $vbox->pack_start ($hbox2, 0, 0, 5);
     $vbox->pack_start ($hbox3, 0, 0, 5);
 
-    if ($country) {
+    if ($country && $ctr->{$country}) {
 	$w->set_text ($ctr->{$country}->{name});
     }
 
@@ -2974,11 +2974,16 @@ sub create_intro_view {
 
 $ipconf = get_ip_config ();
 
-$country = detect_country() if $ipconf->{default} || $opt_testmode;;
+$country = detect_country() if $ipconf->{default} || $opt_testmode;
 
 # read country, kmap and timezone infos
 $cmap = read_cmap ();
 
+if (!defined($cmap->{country}->{$country})) {
+    print $logfd "ignoring detected country '$country', invalid or unknown\n";
+    $country = undef;
+}
+
 create_main_window ();
 
 my $initial_error = 0;
-- 
2.11.0





More information about the pve-devel mailing list