]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
python-common: fix osdspec_affinity check 54786/head
authorGuillaume Abrioux <gabrioux@ibm.com>
Tue, 5 Dec 2023 16:58:07 +0000 (17:58 +0100)
committerGuillaume Abrioux <gabrioux@ibm.com>
Tue, 5 Dec 2023 16:58:07 +0000 (17:58 +0100)
When no `service_id` is provided to service spec (osd) it results in
OSDs created with "osdspec_affinity" attribute set to a string
containing "None".

The DriveSelection class relies on the comparison of the actual
value of this attribute with the value of the service_id which has
the python type `None` in that case.

If any existing deployments were created without the service_id
attribute, we now have to support this case and make sure the check
won't filter out devices unexpectedly.

Fixes: https://tracker.ceph.com/issues/63729
Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
src/python-common/ceph/deployment/drive_selection/selector.py

index 1b3bfbb4ee3c5772bb61a9d6cd502b83b49d1e28..86fd4616fdac3b81fec9fda95a5320fdecc2ea8f 100644 (file)
@@ -132,7 +132,7 @@ class DriveSelection(object):
                 other_osdspec_affinity = ''
                 for lv in disk.lvs:
                     if 'osdspec_affinity' in lv.keys():
-                        if lv['osdspec_affinity'] != self.spec.service_id:
+                        if lv['osdspec_affinity'] != str(self.spec.service_id):
                             other_osdspec_affinity = lv['osdspec_affinity']
                             break
                 if other_osdspec_affinity: