]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph-disk: more precise error message when a disk is specified
authorKefu Chai <kchai@redhat.com>
Thu, 28 Sep 2017 09:44:09 +0000 (17:44 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 28 Sep 2017 10:03:14 +0000 (18:03 +0800)
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 <kchai@redhat.com>
src/ceph-disk/ceph_disk/main.py

index 0a27d43af73af5bd408ac97ced8d5f2a51aa44e7..69f4b595d44ab85d787346ec05fdde139a401ee8 100644 (file)
@@ -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):