Skip to content

Commit

Permalink
Merge pull request #884 from sacsant/mapper
Browse files Browse the repository at this point in the history
lib/blockdev: Handle devicemapper path
  • Loading branch information
cgwalters authored Nov 8, 2024
2 parents affc8b9 + 9e3c384 commit 34b490f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/src/blockdev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ pub(crate) struct Device {
// Filesystem-related properties
pub(crate) label: Option<String>,
pub(crate) fstype: Option<String>,
pub(crate) path: Option<String>,
}

impl Device {
#[allow(dead_code)]
// RHEL8's lsblk doesn't have PATH, so we do it
pub(crate) fn path(&self) -> String {
format!("/dev/{}", &self.name)
self.path.clone().unwrap_or(format!("/dev/{}", &self.name))
}

pub(crate) fn has_children(&self) -> bool {
Expand Down

0 comments on commit 34b490f

Please sign in to comment.