From f2a86506adb95428ad4dc85901df7580d155c2e4 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 28 Sep 2017 17:44:09 +0800 Subject: [PATCH] ceph-disk: more precise error message when a disk is specified we raise an exception if the path is not a block device, e.g. /dev/tty, or it's disk, e.g, /dev/sda. Signed-off-by: Kefu Chai --- src/ceph-disk/ceph_disk/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ceph-disk/ceph_disk/main.py b/src/ceph-disk/ceph_disk/main.py index 0a27d43af73..69f4b595d44 100644 --- a/src/ceph-disk/ceph_disk/main.py +++ b/src/ceph-disk/ceph_disk/main.py @@ -859,7 +859,7 @@ def get_partition_base_mpath(dev): def is_partition(dev): """ - Check whether a given device path is a partition or a full disk. + Check whether a given device path is a partition """ if is_mpath(dev): return is_partition_mpath(dev) @@ -879,7 +879,7 @@ def is_partition(dev): if os.path.exists('/sys/dev/block/%d:%d/partition' % (major, minor)): return True - raise Error('not a disk or partition', dev) + raise Error('not a disk partition', dev) def is_mounted(dev): -- 2.39.5