Handle OSD index errors during stats collection

This commit is contained in:
Joshua Boniface 2023-11-01 21:33:40 -04:00
parent 526a5f4a74
commit 8b93f9a80e
1 changed files with 29 additions and 26 deletions

View File

@ -350,6 +350,7 @@ def collect_ceph_stats(logger, config, zkhandler, this_node, queue):
elif line[0] == "+": elif line[0] == "+":
continue continue
try:
# If line begins with | and second entry is a digit (i.e. OSD ID) # If line begins with | and second entry is a digit (i.e. OSD ID)
if line[0] == "|" and line[1].isdigit(): if line[0] == "|" and line[1].isdigit():
# Parse the line in Ceph 14 format # Parse the line in Ceph 14 format
@ -377,6 +378,8 @@ def collect_ceph_stats(logger, config, zkhandler, this_node, queue):
# Otherwise, it's the header line and is ignored # Otherwise, it's the header line and is ignored
else: else:
continue continue
except IndexError:
continue
# I don't know why 2018 me used this construct instead of a normal # I don't know why 2018 me used this construct instead of a normal
# dictionary update, but it works so not changing it. # dictionary update, but it works so not changing it.