Show Ubuntu phased updates separately from available updates

apt lists updates deferred by phasing in an indented block rather than
as Inst lines, so they were already excluded from the counts but
invisible. The agent now parses that block into phased_packages; the
dashboard shows "+N phased" in the Updates column (with a tooltip) and
the list on the host page. Phasing never affects status: Ubuntu doesn't
phase security updates, and there's nothing to act on until apt offers
the update.

Run the apt simulation with LC_ALL=C since we parse its messages (the
systemd unit already runs in the C locale; manual --print may not).
Agent and server 0.3.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
patrickandClaude Opus 5.5 committed 2026-10-17 12:03:02 -04:00
1 parent ac17a98e91
commit 271af3b071
8 files changed
+76 -7

No files matched your search

+7 -1
View File
@@ -127,7 +127,9 @@ class DashboardTest(ServerCase):
"os_pretty_name": "Ubuntu 24.04.3 LTS <b>",
"apt_lists_age_seconds": 60,
"agent_version": "0.1.0",
"services_need_restart": ["nginx.service"]})
"services_need_restart": ["nginx.service"],
"upgradable_count": 2, "security_count": 1,
"phased_packages": ["systemd", "udev", "libudev1"]})
status, headers, _ = self.login("admin", "a-long-password")
self.assertEqual(status, 303)
@@ -143,6 +145,10 @@ class DashboardTest(ServerCase):
self.assertIn("never reported", body)
self.assertIn("1 service needs restart: nginx", body)
self.assertIn("agent 0.1.0 is older", body)
self.assertIn("2 (1 sec) +3 phased", body)
web01_reasons = body[body.rindex('<td class="reasons">'):].split("</td>")[0] # last row
self.assertIn("security update", web01_reasons)
self.assertNotIn("phas", web01_reasons, "phasing is never a status reason")
self.assertIn("&lt;b&gt;", body, "report content must be escaped")
self.assertNotIn("<b>\n", body)
# Worst first: stale db01 before reboot web01.