From 3d0e7ca6cbd18bb19e3a9357db7bc5cb3f6f2f1a Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sun, 20 Sep 2015 14:12:25 +0200 Subject: [PATCH] ceph-disk: make ceph-disk list /dev/vdb equivalent to list vdb 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 --- src/ceph-disk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ceph-disk b/src/ceph-disk index 70fe4238af2ff..d8f67ce615c74 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -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: -- 2.39.5