Skip to content

Commit

Permalink
prairiedog: if the variant doesn't support boot settings be okay with…
Browse files Browse the repository at this point in the history
… None
  • Loading branch information
jmt-lab committed Mar 20, 2024
1 parent d533ff6 commit bed78a7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sources/api/prairiedog/src/bootconfig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,14 @@ fn get_boot_config_settings<P>(config_path: P) -> Result<Option<BootSettings>>
where
P: AsRef<Path>,
{
let config_str = fs::read_to_string(config_path.as_ref()).context(error::ReadFileSnafu {
path: config_path.as_ref().to_path_buf(),
let config_path = config_path.as_ref();
if !config_path.try_exists().context(error::ReadFileSnafu {
path: config_path.to_path_buf(),
})? {
return Ok(None);
}
let config_str = fs::read_to_string(config_path).context(error::ReadFileSnafu {
path: config_path.to_path_buf(),
})?;
toml::from_str(config_str.as_str()).context(error::InputTomlSnafu)
}
Expand Down

0 comments on commit bed78a7

Please sign in to comment.