Merge pull request #21415 from ErwanAliasr1/evelu-cephdisk

ceph-disk: get_partition_dev() should fail until get_dev_path(partnam…

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2018-05-11 22:32:22 +08:00 committed by GitHub
commit c67d35f282
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -781,6 +781,10 @@ def get_partition_dev(dev, pnum):
if not partname or len(f) < len(partname):
partname = f
if partname:
# BLOCKDIR is populated but is it the case of get_dev_path(partname) ?
if not os.path.exists(get_dev_path(partname)):
raise Error('%s is not populated while %s has it' %
(get_dev_path(partname), sys_entry))
return get_dev_path(partname)
else:
raise Error('partition %d for %s does not appear to exist%s' %