]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: make ceph-disk list /dev/vdb equivalent to list vdb
authorLoic Dachary <ldachary@redhat.com>
Sun, 20 Sep 2015 12:12:25 +0000 (14:12 +0200)
committerLoic Dachary <ldachary@redhat.com>
Tue, 22 Sep 2015 06:46:56 +0000 (08:46 +0200)
The ceph-disk list argument must be the device name without the leading
/dev/. This is error prone and silently does nothing. Strip the /dev/
prefix of ceph-disk list arguments so that it behaves as expected.

http://tracker.ceph.com/issues/13154 Fixes: #13154

Signed-off-by: Loic Dachary <ldachary@redhat.com>
src/ceph-disk

index 70fe4238af2fff637f6998ad6d912a31e9683e01..d8f67ce615c74c746de27536450888f1a6ecf835 100755 (executable)
@@ -534,7 +534,9 @@ def list_all_partitions(names):
     """
     Return a list of devices and partitions
     """
-    if not names:
+    if names:
+        names = map(lambda x: re.sub('^/dev/', '', x), names)
+    else:
         names = os.listdir('/sys/block')
     dev_part_list = {}
     for name in names: