From: Thomas Lamprecht Date: Tue, 23 Apr 2024 12:43:52 +0000 (+0200) Subject: auto installer: drop fetch-from auto mode X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=1470045272316c9581f4bc824a9747c2485df0f5;p=pve-installer.git auto installer: drop fetch-from auto mode 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 --- diff --git a/proxmox-auto-install-assistant/src/main.rs b/proxmox-auto-install-assistant/src/main.rs index c6657f3..a745f7a 100644 --- a/proxmox-auto-install-assistant/src/main.rs +++ b/proxmox-auto-install-assistant/src/main.rs @@ -125,7 +125,7 @@ struct CommandPrepareISO { target: Option, /// 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", diff --git a/proxmox-auto-installer/src/utils.rs b/proxmox-auto-installer/src/utils.rs index 83978b8..8218ed4 100644 --- a/proxmox-auto-installer/src/utils.rs +++ b/proxmox-auto-installer/src/utils.rs @@ -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, diff --git a/proxmox-fetch-answer/src/main.rs b/proxmox-fetch-answer/src/main.rs index 439586f..9a7f6e2 100644 --- a/proxmox-fetch-answer/src/main.rs +++ b/proxmox-fetch-answer/src/main.rs @@ -26,16 +26,6 @@ pub fn init_log() -> Result<()> { fn fetch_answer(install_settings: &AutoInstSettings) -> Result { 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) {