diff --git a/proxmox-auto-install-assistant/src/main.rs b/proxmox-auto-install-assistant/src/main.rs index c837cba..6796c06 100644 --- a/proxmox-auto-install-assistant/src/main.rs +++ b/proxmox-auto-install-assistant/src/main.rs @@ -11,11 +11,11 @@ use std::{ }; use proxmox_auto_installer::{ - answer::Answer, - answer::FilterMatch, + answer::{Answer, FilterMatch}, sysinfo::SysInfo, utils::{ - get_matched_udev_indexes, get_nic_list, get_single_udev_index, AutoInstSettings, + get_matched_udev_indexes, get_nic_list, get_single_udev_index, + verify_email_and_root_password_settings, AutoInstSettings, FetchAnswerFrom, HttpOptions, }, }; @@ -591,7 +591,8 @@ fn parse_answer(path: impl AsRef + fmt::Debug) -> Result { } match toml::from_str(&contents) { Ok(answer) => { - println!("The file was parsed successfully, no syntax errors found!"); + verify_email_and_root_password_settings(&answer)?; + println!("The answer file was parsed successfully, no errors found!"); Ok(answer) } Err(err) => bail!("Error parsing answer file: {err}"), diff --git a/proxmox-auto-installer/src/utils.rs b/proxmox-auto-installer/src/utils.rs index 27bbc3b..c26b33c 100644 --- a/proxmox-auto-installer/src/utils.rs +++ b/proxmox-auto-installer/src/utils.rs @@ -320,7 +320,7 @@ fn verify_locale_settings(answer: &Answer, locales: &LocaleInfo) -> Result<()> { Ok(()) } -fn verify_email_and_root_password_settings(answer: &Answer) -> Result<()> { +pub fn verify_email_and_root_password_settings(answer: &Answer) -> Result<()> { info!("Verifying email and root password settings"); email_validate(&answer.global.mailto).with_context(|| answer.global.mailto.clone())?;