diff --git a/AppImage/scripts/kernel_reboot.py b/AppImage/scripts/kernel_reboot.py index 2d2de9eb..7998ba37 100644 --- a/AppImage/scripts/kernel_reboot.py +++ b/AppImage/scripts/kernel_reboot.py @@ -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), []) diff --git a/tests/test_reboot_health_refresh.py b/tests/test_reboot_health_refresh.py index 4a52392f..2a046066 100644 --- a/tests/test_reboot_health_refresh.py +++ b/tests/test_reboot_health_refresh.py @@ -63,6 +63,7 @@ class FullHealth(unittest.TestCase): self.assertTrue(result['health']['details']['updates']['reboot_required']) self.assertEqual(result['health']['details']['updates']['count'], 0) self.assertEqual(result['health']['timestamp'], 'original') + self.assertEqual(result['health']['summary'], 'Reboot required: running 7.0.14-25-pve; installed 7.0.14-26-pve') self.assertEqual(self.cached, before) self.owner.get_detailed_status.assert_not_called() self.assertEqual(self.probe.call_count, 1)