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>
(cherry picked from commit
b3c7cb098195111b9c642e5a9b726b63717f2e0d)
'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