From: Rafał Wądołowski Date: Fri, 4 Dec 2020 12:25:58 +0000 (+0100) Subject: ceph-volume: disable cache for blkid calls X-Git-Tag: v14.2.22~21^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=925317e98c5cd932a59796d7255cd85bc0f4a1f9;p=ceph.git ceph-volume: disable cache for blkid calls Due to bugs in cache managment in blkid, there are possible to have nonexistence entries. This entries breaks ceph-volume operations by passing two or more outputs instead of one (eg. /dev/sdk2). Fixes: https://tracker.ceph.com/issues/48464 Signed-off-by: Rafał Wądołowski (cherry picked from commit 90ed2e03198edec4a61dd9d6010e8d7b306b5f3a) --- diff --git a/src/ceph-volume/ceph_volume/util/disk.py b/src/ceph-volume/ceph_volume/util/disk.py index 2cf18cb52497..f222109b83cc 100644 --- a/src/ceph-volume/ceph_volume/util/disk.py +++ b/src/ceph-volume/ceph_volume/util/disk.py @@ -24,7 +24,7 @@ def get_partuuid(device): device """ out, err, rc = process.call( - ['blkid', '-s', 'PARTUUID', '-o', 'value', device] + ['blkid', '-c', '/dev/null', '-s', 'PARTUUID', '-o', 'value', device] ) return ' '.join(out).strip() @@ -98,7 +98,7 @@ def blkid(device): PART_ENTRY_UUID PARTUUID """ out, err, rc = process.call( - ['blkid', '-p', device] + ['blkid', '-c', '/dev/null', '-p', device] ) return _blkid_parser(' '.join(out)) @@ -110,7 +110,7 @@ def get_part_entry_type(device): used for udev rules, but it is useful in this case as it is the only consistent way to retrieve the GUID used by ceph-disk to identify devices. """ - out, err, rc = process.call(['blkid', '-p', '-o', 'udev', device]) + out, err, rc = process.call(['blkid', '-c', '/dev/null', '-p', '-o', 'udev', device]) for line in out: if 'ID_PART_ENTRY_TYPE=' in line: return line.split('=')[-1].strip() @@ -123,7 +123,7 @@ def get_device_from_partuuid(partuuid): device is """ out, err, rc = process.call( - ['blkid', '-t', 'PARTUUID="%s"' % partuuid, '-o', 'device'] + ['blkid', '-c', '/dev/null', '-t', 'PARTUUID="%s"' % partuuid, '-o', 'device'] ) return ' '.join(out).strip()