Does not work for me

RAID CRITICAL: 1 array not ok – Array 0 is in state “clean ” (raid1) [1 array checked]

To chomp spaces, if state = “clean ” or “active ”

if “State :” in line:
state = line.split(“:”)[-1][1:-1]
state = state[:-1]