]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: fix broken workaround for atari partitions
authorGuillaume Abrioux <gabrioux@ibm.com>
Thu, 13 Jul 2023 12:14:56 +0000 (12:14 +0000)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 25 Jul 2023 08:33:04 +0000 (08:33 +0000)
broken by bea9f4b643ce32268ad79c0fc257b25ff2f8333c
This commits fixes that regression.

Fixes: https://tracker.ceph.com/issues/62001
Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
(cherry picked from commit b3fd5b513176fb9ba1e6e0595ded4b41d401c68e)

src/ceph-volume/ceph_volume/devices/raw/list.py

index a9eb413120df4a2214be03217ac19058ce27c294..b1a5215b7eb64c32afeb6a32cdc470db0979e8bb 100644 (file)
@@ -88,18 +88,18 @@ class List(object):
             # parent isn't bluestore, then the child could be a valid bluestore OSD. If we fail to
             # determine whether a parent is bluestore, we should err on the side of not reporting
             # the child so as not to give a false negative.
-            for info_device in info_devices:
-                if 'PKNAME' in info_device and info_device['PKNAME'] != "":
-                    parent = info_device['PKNAME']
-                    try:
-                        if disk.has_bluestore_label(parent):
-                            logger.warning(('ignoring child device {} whose parent {} is a BlueStore OSD.'.format(dev, parent),
-                                            'device is likely a phantom Atari partition. device info: {}'.format(info_device)))
-                            continue
-                    except OSError as e:
-                        logger.error(('ignoring child device {} to avoid reporting invalid BlueStore data from phantom Atari partitions.'.format(dev),
-                                    'failed to determine if parent device {} is BlueStore. err: {}'.format(parent, e)))
+            info_device = [info for info in info_devices if info['NAME'] == dev][0]
+            if 'PKNAME' in info_device and info_device['PKNAME'] != "":
+                parent = info_device['PKNAME']
+                try:
+                    if disk.has_bluestore_label(parent):
+                        logger.warning(('ignoring child device {} whose parent {} is a BlueStore OSD.'.format(dev, parent),
+                                        'device is likely a phantom Atari partition. device info: {}'.format(info_device)))
                         continue
+                except OSError as e:
+                    logger.error(('ignoring child device {} to avoid reporting invalid BlueStore data from phantom Atari partitions.'.format(dev),
+                                'failed to determine if parent device {} is BlueStore. err: {}'.format(parent, e)))
+                    continue
 
             bs_info = _get_bluestore_info(dev)
             if bs_info is None: