On 04/01/2009 10:48 PM, Jeremy Katz wrote:
On Wednesday, April 01 2009, Hans de Goede said:
diff --git a/storage/devices.py b/storage/devices.py
index 32e4c23..4189eb4 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -131,6 +131,14 @@ def get_device_majors():
device_majors = get_device_majors()
+def devicePathToDeviceName(path):
+ name = path[5:]
+ if name.startswith("mapper/")
+ name = name[7:]
+
+ return name
Would it make sense to have this as a method of the device rather than a
stand-alone function? It looks like everywhere you're using it has a
device/partition
Nope, everywhere has a string containing /dev/foo or /dev/foo/bar, if we
had an actual device we could just use Device.name and be done with it.
Regards,
Hans
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list