Skip to content

Commit

Permalink
Make some uninstall failures not fatal (#1994)
Browse files Browse the repository at this point in the history
If the uninstall process can't find any omicron datasets, print a
message and continue.  It is possible they don't exist yet and the
install steps later will create them if needed.

Co-authored-by: Alan Hanson <[email protected]>
  • Loading branch information
leftwo and Alan Hanson authored Nov 30, 2022
1 parent a8611d0 commit 7cab5cf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions package/src/bin/omicron-package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ use omicron_zone_package::target::Target;
use rayon::prelude::*;
use ring::digest::{Context as DigestContext, Digest, SHA256};
use slog::debug;
use slog::info;
use slog::o;
use slog::Drain;
use slog::Logger;
use slog::{info, warn};
use std::env;
use std::fs::create_dir_all;
use std::io::Write;
Expand Down Expand Up @@ -454,7 +454,14 @@ fn get_all_omicron_datasets() -> Result<Vec<String>> {
}

fn uninstall_all_omicron_datasets(config: &Config) -> Result<()> {
let datasets = get_all_omicron_datasets()?;
let datasets = match get_all_omicron_datasets() {
Err(e) => {
warn!(config.log, "Failed to get omicron datasets: {}", e);
return Ok(());
}
Ok(datasets) => datasets,
};

if datasets.is_empty() {
return Ok(());
}
Expand Down

0 comments on commit 7cab5cf

Please sign in to comment.