Skip to content

Commit

Permalink
fix unsupported operand type and chnage the logic for
Browse files Browse the repository at this point in the history
fetching OSD PDBs

Signed-off-by: vavuthu <[email protected]>
  • Loading branch information
vavuthu committed Jul 11, 2024
1 parent 4cf101f commit cb1d807
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ocs_ci/ocs/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -2176,18 +2176,19 @@ def validate_existence_of_blocking_pdb():
pdb_obj_get = pdb_obj.get()
osd_pdb = []
for pdb in pdb_obj_get.get("items"):
if not any(
osd in pdb["metadata"]["name"]
for osd in [constants.MDS_PDB, constants.MON_PDB]
):
# blocking OSD PDBs are in the format of rook-ceph-osd-zone-data-1
if constants.OSD_PDB in pdb["metadata"]["name"]:
osd_pdb.append(pdb)
blocking_pdb_exist = False
for osd in range(len(osd_pdb)):
allowed_disruptions = osd_pdb[osd].get("status").get("disruptionsAllowed")
maximum_unavailable = osd_pdb[osd].get("spec").get("maxUnavailable")
if allowed_disruptions & maximum_unavailable != 1:
logger.info("Blocking PDBs are created")
if allowed_disruptions & (maximum_unavailable != 1):
logger.info(
f"Blocking PDB {osd_pdb[osd].get('metadata').get('name')} are created"
)
blocking_pdb_exist = True
return blocking_pdb_exist
else:
logger.info(
f"No blocking PDBs created, OSD PDB is {osd_pdb[osd].get('metadata').get('name')}"
Expand Down

0 comments on commit cb1d807

Please sign in to comment.