Skip to content

Commit

Permalink
mod:set_counter when boot_countre is not i32
Browse files Browse the repository at this point in the history
Signed-off-by: Sayan Paul <[email protected]>
  • Loading branch information
say-paul committed Apr 15, 2024
1 parent 470640a commit 40eee34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ pub fn set_boot_counter(reboot_count: i32) -> Result<()> {
log::info!("boot_counter={current_counter}");
bail!("counter already set");
}
Ok(None) => {
_ => {
//will still try to set boot_counter to override cases like boot_counter=<some_string>
log::info!("setting boot counter");
set_grub_var("boot_counter", reboot_count)?;
}
Err(e) => bail!(e),
}
Ok(())
}
Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ enum Commands {
Rollback,
}

/// this runs the scripts in required.d and wanted.d
/// runs all the scripts in required.d and wanted.d
fn run_diagnostics() -> Result<()> {
let mut required_script_failure: bool = false;
let mut path_exists: bool = false;
Expand Down Expand Up @@ -142,7 +142,7 @@ fn run_diagnostics() -> Result<()> {
Ok(())
}

/// runs the scripts in red.d when health-check fails
/// runs all the scripts in red.d when health-check fails
fn run_red() -> Result<(), Vec<Box<dyn Error>>> {
let mut errors = Vec::new();
for path in GREENBOOT_INSTALL_PATHS {
Expand All @@ -158,7 +158,7 @@ fn run_red() -> Result<(), Vec<Box<dyn Error>>> {
}
}

/// runs the scripts green.d when health-check passes
/// runs all the scripts green.d when health-check passes
fn run_green() -> Result<(), Vec<Box<dyn Error>>> {
let mut errors = Vec::new();
for path in GREENBOOT_INSTALL_PATHS {
Expand Down

0 comments on commit 40eee34

Please sign in to comment.