fix: retain translated reboot summary in cached health responses

This commit is contained in:
VAIO73
2026-10-28 17:30:44 +00:00
parent ac9565fa19
commit 503a946d85
2 changed files with 7 additions and 1 deletions
+6 -1
View File
@@ -108,7 +108,12 @@ def refresh_health_reboot(snapshot):
if status in issues:
label = key.replace('_', ' ').capitalize()
reason = block.get('reason')
issues[status].append(f'{label}: {reason}' if reason else label)
if key == 'updates' and not reason:
# Reuse the existing localized reboot detail contract rather
# than introducing an untranslated, context-free "Updates".
issues[status].append(block['checks']['reboot_required']['detail'])
else:
issues[status].append(f'{label}: {reason}' if reason else label)
result['overall'] = ('CRITICAL' if issues['CRITICAL'] else 'WARNING'
if issues['WARNING'] or issues['UNKNOWN'] else 'OK')
primary = next((values for values in issues.values() if values), [])