From: Kefu Chai Date: Thu, 28 Sep 2017 09:44:09 +0000 (+0800) Subject: ceph-disk: more precise error message when a disk is specified X-Git-Tag: v13.0.1~734^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f2a86506adb95428ad4dc85901df7580d155c2e4;p=ceph.git 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 --- diff --git a/src/ceph-disk/ceph_disk/main.py b/src/ceph-disk/ceph_disk/main.py index 0a27d43af73a..69f4b595d44a 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):