From: Joe Julian Date: Fri, 9 Oct 2015 19:57:06 +0000 (-0700) Subject: Compare parted output with the dereferenced path X-Git-Tag: v0.94.6~45^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b2f1e76d8e95b6e2f88fa1c122ea8cd24532cd10;p=ceph.git 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 (cherry picked from commit b3c7cb098195111b9c642e5a9b726b63717f2e0d) --- diff --git a/src/ceph-disk b/src/ceph-disk index 4a485201a4fe5..a32200cd3076b 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -996,9 +996,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