Ensure unresponsive OSDs still display in list

It is still useful to see such dead OSDs even if they've never checked
in or have not checked in for quite some time.
This commit is contained in:
Joshua Boniface 2022-04-29 11:36:09 -04:00
parent 4d698be34b
commit 413100a147
1 changed files with 12 additions and 2 deletions

View File

@ -367,10 +367,20 @@ def format_list_osd(osd_list):
for osd_information in osd_list: for osd_information in osd_list:
try: try:
# If this happens, the node hasn't checked in fully yet, so just ignore it # If this happens, the node hasn't checked in fully yet, so use some dummy data
if osd_information["stats"]["node"] == "|": if osd_information["stats"]["node"] == "|":
continue for key in osd_information["stats"].keys():
if osd_information["stats"][key] == "|":
osd_information["stats"][key] = "N/A"
elif osd_information["stats"][key] is None:
osd_information["stats"][key] = "N/A"
for key in osd_information.keys():
if osd_information[key] is None:
osd_information[key] = "N/A"
except KeyError: except KeyError:
print(
f"Details for OSD {osd_information['id']} missing required keys, skipping."
)
continue continue
# Deal with the size to human readable # Deal with the size to human readable