summaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2011-05-10 10:43:51 -0700
committerDavid Cantrell <dcantrell@redhat.com>2011-05-10 10:43:51 -0700
commite7e25762c4ed1256f8fef2aae2a558134f48ad46 (patch)
tree400d3baad3ebadb31459e764b1629ded5905e487 /data
parent54902c68286665d02b42afb6bae33daab6dfdba6 (diff)
downloadanaconda-e7e25762c4ed1256f8fef2aae2a558134f48ad46.tar.gz
anaconda-e7e25762c4ed1256f8fef2aae2a558134f48ad46.tar.xz
anaconda-e7e25762c4ed1256f8fef2aae2a558134f48ad46.zip
Trim "/dev/" correctly in list-harddrives (#702430).
Trim the leading /dev/ from device node names in the list-harddrives command-stub.
Diffstat (limited to 'data')
-rwxr-xr-xdata/command-stubs/list-harddrives-stub7
1 files changed, 6 insertions, 1 deletions
diff --git a/data/command-stubs/list-harddrives-stub b/data/command-stubs/list-harddrives-stub
index 40251865b..75e8f8906 100755
--- a/data/command-stubs/list-harddrives-stub
+++ b/data/command-stubs/list-harddrives-stub
@@ -27,7 +27,12 @@ def main(argv):
lst = set()
for dev in filter(lambda d: d.type != parted.DEVICE_DM, parted.getAllDevices()):
- lst.add((os.path.basename(dev.path), dev.getSize()))
+ if dev.path.startswith("/dev/"):
+ path = dev.path[5:]
+ else:
+ path = dev.path
+
+ lst.add((path, dev.getSize()))
lst = list(lst)
lst.sort()