diff options
-rwxr-xr-x | src/ceph-disk | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ceph-disk b/src/ceph-disk index 13d9f8203ce..1d1a1501e79 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -637,6 +637,11 @@ def get_free_partition_index(dev): raise Error('parted failed to output anything') lines = str(lines).splitlines(True) + # work around buggy libreadline(?) library in rhel/centos. + idiot_prefix = '\x1b\x5b\x3f\x31\x30\x33\x34\x68'; + if lines[0].startswith(idiot_prefix): + lines[0] = lines[0][8:] + if lines[0] not in ['CHS;\n', 'CYL;\n', 'BYT;\n']: raise Error('weird parted units', lines[0]) del lines[0] |