]> git.proxmox.com Git - pve-installer.git/commitdiff
auto installer: drop fetch-from auto mode
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 23 Apr 2024 12:43:52 +0000 (14:43 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 23 Apr 2024 13:18:15 +0000 (15:18 +0200)
It simpler to force the user to chose, as then they will always know
where an ISO pulls the answer file from without any complex automatic
fallback logic, which might be also undesired, especially in
environments where one has not full control (trust) over the network.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
proxmox-auto-install-assistant/src/main.rs
proxmox-auto-installer/src/utils.rs
proxmox-fetch-answer/src/main.rs

index c6657f36362ca92fb5660d9a8bed97b6d81b7ad6..a745f7a27473b1ea38b5f7a35416b462d18d870f 100644 (file)
@@ -125,7 +125,7 @@ struct CommandPrepareISO {
     target: Option<PathBuf>,
 
     /// Where to fetch the answer file from.
-    #[arg(short, long, value_enum, default_value_t=AutoInstMode::Auto)]
+    #[arg(short, long, value_enum)]
     install_mode: AutoInstMode,
 
     /// Include the specified answer file in the ISO. Requires the '--install-mode', '-i' parameter
@@ -355,7 +355,6 @@ fn final_iso_location(args: &CommandPrepareISO) -> PathBuf {
         return specified;
     }
     let mut suffix: String = match args.install_mode {
-        AutoInstMode::Auto => "auto",
         AutoInstMode::Http => "auto-http",
         AutoInstMode::Included => "auto-answer-included",
         AutoInstMode::Partition => "auto-part",
index 83978b86de6cf22bdfc85a0946e74959acb88490..8218ed499f45053360e8d7f380bd94089811b4ce 100644 (file)
@@ -70,7 +70,6 @@ pub fn get_single_udev_index(
 #[derive(Deserialize, Serialize, Debug, Clone, ValueEnum, PartialEq)]
 #[serde(rename_all = "lowercase", deny_unknown_fields)]
 pub enum AutoInstMode {
-    Auto,
     Included,
     Http,
     Partition,
index 439586fec2d11bc33d7bf9864bb6db0a80d04a82..9a7f6e29a0de42ecd5a3b2ca0c1a8a1690b011b4 100644 (file)
@@ -26,16 +26,6 @@ pub fn init_log() -> Result<()> {
 fn fetch_answer(install_settings: &AutoInstSettings) -> Result<String> {
     info!("Fetching answer file in mode {:?}:", &install_settings.mode);
     match install_settings.mode {
-        AutoInstMode::Auto => {
-            match FetchFromPartition::get_answer() {
-                Ok(answer) => return Ok(answer),
-                Err(err) => info!("Fetching answer file from partition failed: {err}"),
-            }
-            match FetchFromHTTP::get_answer(install_settings) {
-                Ok(answer) => return Ok(answer),
-                Err(err) => info!("Fetching answer file via HTTP failed: {err}"),
-            }
-        }
         AutoInstMode::Included => {
             let answer_path = PathBuf::from("/cdrom/answer.toml");
             match fs::read_to_string(answer_path) {