Skip to content

Commit 34b490f

Browse files
authored
Merge pull request #884 from sacsant/mapper
lib/blockdev: Handle devicemapper path
2 parents affc8b9 + 9e3c384 commit 34b490f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/src/blockdev.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ pub(crate) struct Device {
3737
// Filesystem-related properties
3838
pub(crate) label: Option<String>,
3939
pub(crate) fstype: Option<String>,
40+
pub(crate) path: Option<String>,
4041
}
4142

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

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

0 commit comments

Comments
 (0)