From b2f1e76d8e95b6e2f88fa1c122ea8cd24532cd10 Mon Sep 17 00:00:00 2001 From: Joe Julian Date: Fri, 9 Oct 2015 12:57:06 -0700 Subject: [PATCH] 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) --- src/ceph-disk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.39.5