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>
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)
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):