From b0ca88befca1654acb814e2d7eab359c8de3f558 Mon Sep 17 00:00:00 2001 From: Lukas Bezdicka Date: Fri, 16 Feb 2024 14:58:02 +0100 Subject: [PATCH] [ceph][luks] Fix ceph cephvolumescan for cephadm For cephadm the containers are named ceph--osd... while ceph-ansible still uses the ceph-osd-... Other issue is that OSDs can have multiple volumes in them so filtering just for the first one is wrong and we need to check each volume for the encryption. Resolves: rhbz#2264543 Fixes: https://issues.redhat.com/browse/RHEL-25838 --- .../actors/cephvolumescan/libraries/cephvolumescan.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/repos/system_upgrade/common/actors/cephvolumescan/libraries/cephvolumescan.py b/repos/system_upgrade/common/actors/cephvolumescan/libraries/cephvolumescan.py index b2364104ba..35056e0ab1 100644 --- a/repos/system_upgrade/common/actors/cephvolumescan/libraries/cephvolumescan.py +++ b/repos/system_upgrade/common/actors/cephvolumescan/libraries/cephvolumescan.py @@ -8,7 +8,7 @@ from leapp.models import InstalledRPM CEPH_CONF = "/etc/ceph/ceph.conf" -CONTAINER = "ceph-osd" +CONTAINER = "ceph-.*osd" def select_osd_container(engine): @@ -63,7 +63,11 @@ def encrypted_osds_list(): output = get_ceph_lvm_list() if output is not None: try: - result = [output[key][0]['lv_uuid'] for key in output if output[key][0]['tags']['ceph.encrypted']] + result = [] + for key in output: + for element in output[key]: + if element['tags']['ceph.encrypted']: + result.append(element['lv_uuid']) except KeyError: # TODO: possibly raise a report item with a medium risk factor # TODO: possibly create list of problematic osds, extend the cephinfo