]> git.proxmox.com Git - pve-installer.git/commitdiff
fix checking the now boolean prompt response
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 22 Jun 2023 05:16:12 +0000 (07:16 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 22 Jun 2023 05:21:19 +0000 (07:21 +0200)
When the prompt abstraction got added in bc05a8f ("add basic UI
plugin infrastructure") it also inlined the check for the answer, as
that can be differently structured for each user interface, and
returns bool. But when switching over to this new infra, two sites
weren't updated to the simpler bool check and still checked with the
previous "equals 'ok'", which now was always false.

Fixes: 72bea99 ("switch prompt, error and message calls to new UI infra")
Reported-by: Alexander Zeidler <a.zeidler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Proxmox/Install.pm
Proxmox/Sys/Block.pm

index 17fe34da1b7e3ccbd3500a3ce045cd3f838f2209..7970f83b0b02f1fdbf7c85d53defb6d665efe4e5 100644 (file)
@@ -366,9 +366,9 @@ sub ask_existing_vg_rename_or_abort {
     }
     $message .= "or cancel the installation?";
 
-    my $response = Proxmox::UI::prompt($message);
+    my $response_ok = Proxmox::UI::prompt($message);
 
-    if ($response eq 'ok') {
+    if ($response_ok) {
        for my $vg_uuid (keys %$duplicate_vgs) {
            my $vg = $duplicate_vgs->{$vg_uuid};
            my $new_vgname = $vg->{new_vgname};
index fdff160933db843f3d2692ebfaf983f289467bc1..bb2fc907a84d37bbf61cf23f82c6eeba31e262b1 100644 (file)
@@ -227,12 +227,12 @@ sub partition_bootable_disk {
 
     die "root disk '$target_dev' too small (${hdgb} GB < $hard_limit GB)\n" if $hdgb < $hard_limit;
     if ($hdgb < $soft_limit) {
-       my $response = Proxmox::UI::prompt(
+       my $response_ok = Proxmox::UI::prompt(
            "Root disk space ${hdgb} GB is below recommended minimum space of $soft_limit GB,"
            ." installation might not be successful! Continue?"
        );
        die "root disk '$target_dev' too small (${hdgb} GB < $soft_limit GB), and warning not accepted.\n"
-           if $response ne 'ok';
+           if $response_ok;
     }
 
     syscmd("sgdisk -Z ${target_dev}");