- Why I did it Fix issue: ERR healthd: Get unit status determine-reboot-cause-'LoadState'. The error log is only seen on shutdown flow such as fast-reboot/warm-reboot. In shutdown flow, 'LoadState' might not be available in systemctl status output, using [] might cause a KeyError. - How I did it Use dict.get instead of [] - How to verify it Manual test Co-authored-by: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com>
This commit is contained in:
parent
ff232d67bd
commit
8dc3a40685
@ -273,7 +273,7 @@ class Sysmonitor(ProcessTaskBase):
|
||||
|
||||
sysctl_show = self.run_systemctl_show(event)
|
||||
|
||||
load_state = sysctl_show['LoadState']
|
||||
load_state = sysctl_show.get('LoadState')
|
||||
if load_state == "loaded":
|
||||
status = sysctl_show['UnitFileState']
|
||||
fail_reason = sysctl_show['Result']
|
||||
|
Loading…
Reference in New Issue
Block a user