mirror of
https://github.com/xcat2/confluent.git
synced 2026-09-28 16:20:54 +00:00
Report node health and unreachable nodes from EUREKA health
get_health looked only at each node's State, so an Enabled node whose Health was Warning or Critical left the chassis reported as ok. It also skipped a node whose resource could not be read, counting it as healthy while an unreadable chassis was flagged. Report the node's Health when it is not OK, and a node that cannot be read as Unreachable.
This commit is contained in:
@@ -177,12 +177,18 @@ class OEMHandler(generic.OEMHandler):
|
||||
note_issue('Chassis', const.Health.Warning, 'Unreachable')
|
||||
|
||||
for sysurl in self._allsysurls:
|
||||
name = sysurl.rstrip('/').rsplit('/', 1)[-1]
|
||||
try:
|
||||
sysinfo = await self._do_web_request(sysurl)
|
||||
except Exception:
|
||||
note_issue(name, const.Health.Warning, 'Unreachable')
|
||||
continue
|
||||
state = sysinfo.get('Status', {}).get('State', 'Absent')
|
||||
name = sysurl.rstrip('/').rsplit('/', 1)[-1]
|
||||
status = sysinfo.get('Status', {})
|
||||
state = status.get('State', 'Absent')
|
||||
health = status.get('Health', 'OK')
|
||||
if state != 'Enabled':
|
||||
note_issue(name, const.Health.Warning, state)
|
||||
elif health != 'OK':
|
||||
note_issue(name, generic._healthmap.get(
|
||||
health, const.Health.Warning), health)
|
||||
return summary
|
||||
|
||||
Reference in New Issue
Block a user