This is specifically for the case of DiskFile, which has an
arbitrary file path, but it looks like the entire method could be
replaced with the basename call.
---
blivet/devices/lib.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/blivet/devices/lib.py b/blivet/devices/lib.py
index cd9d7b2..369b64d 100644
--- a/blivet/devices/lib.py
+++ b/blivet/devices/lib.py
@@ -18,6 +18,8 @@
#
# Red Hat Author(s): David Lehman <dlehman(a)redhat.com>
#
+import os
+
from .. import errors
from .. import udev
@@ -57,6 +59,9 @@ def devicePathToName(devicePath):
if name.startswith("md/"):
name = name[3:]
+ if name.startswith("/"):
+ name = os.path.basename(name)
+
return name
def deviceNameToDiskByPath(deviceName=None):
--
1.9.3