Skip to content

Commit

Permalink
Include device set even if encryption info inconsistent
Browse files Browse the repository at this point in the history
Signed-off-by: mulhern <amulhern@redhat.com>
  • Loading branch information
mulkieran committed May 26, 2023
1 parent 1c04b1b commit a37ee64
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
16 changes: 6 additions & 10 deletions src/engine/strat_engine/liminal/device_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -668,18 +668,14 @@ impl DeviceSet {

/// The encryption information and devices registered for stopped pools to
/// be exported over the API.
///
/// Error from gather_encryption_info is converted into an option because
/// unlocked Stratis devices and LUKS2 devices on which the Stratis devices are
/// stored may appear at different times in udev. This is not necessarily
/// an error case and may resolve itself after more devices appear in udev.
pub fn stopped_pool_info(&self) -> Option<StoppedPoolInfo> {
gather_encryption_info(
pub fn stopped_pool_info(&self) -> StoppedPoolInfo {
let info = gather_encryption_info(
self.internal.len(),
self.internal.values().map(|info| info.encryption_info()),
)
.ok()
.map(|info| StoppedPoolInfo {
.unwrap_or(None);

StoppedPoolInfo {
info,
devices: self
.internal
Expand All @@ -699,7 +695,7 @@ impl DeviceSet {
}
})
.collect::<Vec<_>>(),
})
}
}

/// Process the data from a remove udev event. Since remove events are
Expand Down
8 changes: 2 additions & 6 deletions src/engine/strat_engine/liminal/liminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,16 +401,12 @@ impl LiminalDevices {
stopped: self
.stopped_pools
.iter()
.filter_map(|(pool_uuid, map)| {
map.stopped_pool_info().map(|info| (*pool_uuid, info))
})
.map(|(pool_uuid, map)| (*pool_uuid, map.stopped_pool_info()))
.collect(),
partially_constructed: self
.partially_constructed_pools
.iter()
.filter_map(|(pool_uuid, map)| {
map.stopped_pool_info().map(|info| (*pool_uuid, info))
})
.map(|(pool_uuid, map)| (*pool_uuid, map.stopped_pool_info()))
.collect(),
}
}
Expand Down

0 comments on commit a37ee64

Please sign in to comment.