Skip to content

Commit

Permalink
Compare parted output with the dereferenced path
Browse files Browse the repository at this point in the history
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: ceph#13438

Signed-off-by: Joe Julian <[email protected]>
  • Loading branch information
Joe Julian committed Nov 18, 2015
1 parent 133b0de commit b3c7cb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ceph-disk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b3c7cb0

Please sign in to comment.