[pve-devel] [PATCH installer v4 3/4] install: config: rename option lvm_auto_rename -> existing_storage_auto_rename

Christoph Heiss c.heiss at proxmox.com
Tue Jul 16 10:18:09 CEST 2024


As this is an internal option for the low-level installer anyway, no
real functional changes here.

Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
---
Changes v3 -> v4:
  * rename $response_ok -> $do_rename for clarity in
    ask_existing_vg_rename_or_abort()

Changes v2 -> v3:
  * new patch

 Proxmox/Install.pm                                        | 8 ++++----
 Proxmox/Install/Config.pm                                 | 6 +++---
 proxmox-auto-installer/src/utils.rs                       | 2 +-
 .../tests/resources/parse_answer/disk_match.json          | 2 +-
 .../tests/resources/parse_answer/disk_match_all.json      | 2 +-
 .../tests/resources/parse_answer/disk_match_any.json      | 2 +-
 .../tests/resources/parse_answer/minimal.json             | 2 +-
 .../tests/resources/parse_answer/nic_matching.json        | 2 +-
 .../tests/resources/parse_answer/specific_nic.json        | 2 +-
 .../tests/resources/parse_answer/zfs.json                 | 2 +-
 proxmox-installer-common/src/setup.rs                     | 2 +-
 proxmox-tui-installer/src/setup.rs                        | 2 +-
 12 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/Proxmox/Install.pm b/Proxmox/Install.pm
index c0f8955..9efa4f1 100644
--- a/Proxmox/Install.pm
+++ b/Proxmox/Install.pm
@@ -384,8 +384,8 @@ sub ask_existing_vg_rename_or_abort {
 	$vg->{new_vgname} = "$vgname-OLD-$short_uid";
     }
 
-    my $response_ok = Proxmox::Install::Config::get_lvm_auto_rename();
-    if (!$response_ok) {
+    my $do_rename = Proxmox::Install::Config::get_existing_storage_auto_rename();
+    if (!$do_rename) {
 	my $message = "Detected existing '$vgname' Volume Group(s)! Do you want to:\n";
 
 	for my $vg_uuid (keys %$duplicate_vgs) {
@@ -394,10 +394,10 @@ sub ask_existing_vg_rename_or_abort {
 	}
 	$message .= "or cancel the installation?";
 
-	$response_ok = Proxmox::UI::prompt($message);
+	$do_rename = Proxmox::UI::prompt($message);
     }
 
-    if ($response_ok) {
+    if ($do_rename) {
 	for my $vg_uuid (keys %$duplicate_vgs) {
 	    my $vg = $duplicate_vgs->{$vg_uuid};
 	    my $new_vgname = $vg->{new_vgname};
diff --git a/Proxmox/Install/Config.pm b/Proxmox/Install/Config.pm
index ecd8a74..e449039 100644
--- a/Proxmox/Install/Config.pm
+++ b/Proxmox/Install/Config.pm
@@ -82,7 +82,7 @@ my sub init_cfg {
 	# TODO: single disk selection config
 	target_hd => undef,
 	disk_selection => {},
-	lvm_auto_rename => 0,
+	existing_storage_auto_rename => 0,
 
 	# locale
 	country => $country,
@@ -244,7 +244,7 @@ sub get_dns { return get('dns'); }
 sub set_target_cmdline { set_key('target_cmdline', $_[0]); }
 sub get_target_cmdline { return get('target_cmdline'); }
 
-sub set_lvm_auto_rename { set_key('lvm_auto_rename', $_[0]); }
-sub get_lvm_auto_rename { return get('lvm_auto_rename'); }
+sub set_existing_storage_auto_rename { set_key('existing_storage_auto_rename', $_[0]); }
+sub get_existing_storage_auto_rename { return get('existing_storage_auto_rename'); }
 
 1;
diff --git a/proxmox-auto-installer/src/utils.rs b/proxmox-auto-installer/src/utils.rs
index 202ad41..cc47f5f 100644
--- a/proxmox-auto-installer/src/utils.rs
+++ b/proxmox-auto-installer/src/utils.rs
@@ -328,7 +328,7 @@ pub fn parse_answer(
         zfs_opts: None,
         target_hd: None,
         disk_selection: BTreeMap::new(),
-        lvm_auto_rename: 1,
+        existing_storage_auto_rename: 1,
 
         country: answer.global.country.clone(),
         timezone: answer.global.timezone.clone(),
diff --git a/proxmox-auto-installer/tests/resources/parse_answer/disk_match.json b/proxmox-auto-installer/tests/resources/parse_answer/disk_match.json
index 3a117b6..2618fd4 100644
--- a/proxmox-auto-installer/tests/resources/parse_answer/disk_match.json
+++ b/proxmox-auto-installer/tests/resources/parse_answer/disk_match.json
@@ -10,7 +10,7 @@
 	"8": "8",
 	"9": "9"
   },
-  "lvm_auto_rename": 1,
+  "existing_storage_auto_rename": 1,
   "filesys": "zfs (RAID10)",
   "gateway": "192.168.1.1",
   "hdsize": 223.57088470458984,
diff --git a/proxmox-auto-installer/tests/resources/parse_answer/disk_match_all.json b/proxmox-auto-installer/tests/resources/parse_answer/disk_match_all.json
index 5325fc3..6cfb96a 100644
--- a/proxmox-auto-installer/tests/resources/parse_answer/disk_match_all.json
+++ b/proxmox-auto-installer/tests/resources/parse_answer/disk_match_all.json
@@ -7,7 +7,7 @@
   "disk_selection": {
 	"9": "9"
   },
-  "lvm_auto_rename": 1,
+  "existing_storage_auto_rename": 1,
   "filesys": "zfs (RAID0)",
   "gateway": "192.168.1.1",
   "hdsize": 223.57088470458984,
diff --git a/proxmox-auto-installer/tests/resources/parse_answer/disk_match_any.json b/proxmox-auto-installer/tests/resources/parse_answer/disk_match_any.json
index 18e22d1..1921b34 100644
--- a/proxmox-auto-installer/tests/resources/parse_answer/disk_match_any.json
+++ b/proxmox-auto-installer/tests/resources/parse_answer/disk_match_any.json
@@ -14,7 +14,7 @@
 	"8": "8",
 	"9": "9"
   },
-  "lvm_auto_rename": 1,
+  "existing_storage_auto_rename": 1,
   "filesys": "zfs (RAID10)",
   "gateway": "192.168.1.1",
   "hdsize": 2980.820640563965,
diff --git a/proxmox-auto-installer/tests/resources/parse_answer/minimal.json b/proxmox-auto-installer/tests/resources/parse_answer/minimal.json
index bb72713..38112e4 100644
--- a/proxmox-auto-installer/tests/resources/parse_answer/minimal.json
+++ b/proxmox-auto-installer/tests/resources/parse_answer/minimal.json
@@ -7,7 +7,7 @@
   "filesys": "ext4",
   "gateway": "192.168.1.1",
   "hdsize": 223.57088470458984,
-  "lvm_auto_rename": 1,
+  "existing_storage_auto_rename": 1,
   "hostname": "pveauto",
   "keymap": "de",
   "mailto": "mail at no.invalid",
diff --git a/proxmox-auto-installer/tests/resources/parse_answer/nic_matching.json b/proxmox-auto-installer/tests/resources/parse_answer/nic_matching.json
index de94165..6eb3b8a 100644
--- a/proxmox-auto-installer/tests/resources/parse_answer/nic_matching.json
+++ b/proxmox-auto-installer/tests/resources/parse_answer/nic_matching.json
@@ -7,7 +7,7 @@
   "filesys": "ext4",
   "gateway": "10.10.10.1",
   "hdsize": 223.57088470458984,
-  "lvm_auto_rename": 1,
+  "existing_storage_auto_rename": 1,
   "hostname": "pveauto",
   "keymap": "de",
   "mailto": "mail at no.invalid",
diff --git a/proxmox-auto-installer/tests/resources/parse_answer/specific_nic.json b/proxmox-auto-installer/tests/resources/parse_answer/specific_nic.json
index 5b4fcfc..9791535 100644
--- a/proxmox-auto-installer/tests/resources/parse_answer/specific_nic.json
+++ b/proxmox-auto-installer/tests/resources/parse_answer/specific_nic.json
@@ -7,7 +7,7 @@
   "filesys": "ext4",
   "gateway": "10.10.10.1",
   "hdsize": 223.57088470458984,
-  "lvm_auto_rename": 1,
+  "existing_storage_auto_rename": 1,
   "hostname": "pveauto",
   "keymap": "de",
   "mailto": "mail at no.invalid",
diff --git a/proxmox-auto-installer/tests/resources/parse_answer/zfs.json b/proxmox-auto-installer/tests/resources/parse_answer/zfs.json
index 65724a8..85049cb 100644
--- a/proxmox-auto-installer/tests/resources/parse_answer/zfs.json
+++ b/proxmox-auto-installer/tests/resources/parse_answer/zfs.json
@@ -8,7 +8,7 @@
 	"6": "6",
 	"7": "7"
   },
-  "lvm_auto_rename": 1,
+  "existing_storage_auto_rename": 1,
   "filesys": "zfs (RAID1)",
   "gateway": "192.168.1.1",
   "hdsize": 80.0,
diff --git a/proxmox-installer-common/src/setup.rs b/proxmox-installer-common/src/setup.rs
index 9aa4063..804da1a 100644
--- a/proxmox-installer-common/src/setup.rs
+++ b/proxmox-installer-common/src/setup.rs
@@ -480,7 +480,7 @@ pub struct InstallConfig {
     #[serde(skip_serializing_if = "BTreeMap::is_empty")]
     pub disk_selection: BTreeMap<String, String>,
 
-    pub lvm_auto_rename: usize,
+    pub existing_storage_auto_rename: usize,
 
     pub country: String,
     pub timezone: String,
diff --git a/proxmox-tui-installer/src/setup.rs b/proxmox-tui-installer/src/setup.rs
index 8c01e42..02d9ece 100644
--- a/proxmox-tui-installer/src/setup.rs
+++ b/proxmox-tui-installer/src/setup.rs
@@ -17,7 +17,7 @@ impl From<InstallerOptions> for InstallConfig {
             zfs_opts: None,
             target_hd: None,
             disk_selection: BTreeMap::new(),
-            lvm_auto_rename: 0,
+            existing_storage_auto_rename: 0,
 
             country: options.timezone.country,
             timezone: options.timezone.timezone,
-- 
2.45.1





More information about the pve-devel mailing list