mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
Compare parted output with the dereferenced path
Compare parted output with the dereferenced path of the device as parted prints that instead of the symlink we called it with. http://tracker.ceph.com/issues/13438 Fixes: #13438 Signed-off-by: Joe Julian <jjulian@io.com>
This commit is contained in:
parent
133b0dee86
commit
b3c7cb0981
@ -1220,9 +1220,9 @@ def get_free_partition_index(dev):
|
||||
'BYT;' not in lines):
|
||||
raise Error('parted output expected to contain one of ' +
|
||||
'CHH; CYL; or BYT; : ' + lines)
|
||||
if dev not in lines:
|
||||
if os.path.realpath(dev) not in lines:
|
||||
raise Error('parted output expected to contain ' + dev + ': ' + lines)
|
||||
_, partitions = lines.split(dev)
|
||||
_, partitions = lines.split(os.path.realpath(dev))
|
||||
partition_numbers = extract_parted_partition_numbers(partitions)
|
||||
if partition_numbers:
|
||||
return max(partition_numbers) + 1
|
||||
|
Loading…
Reference in New Issue
Block a user