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:
1 parent
ac17a98e91
commit
271af3b071
8 files changed
+76
-7
No files matched your search
@@ -420,7 +420,13 @@ class Handler(BaseHTTPRequestHandler):
|
||||
name = h["host"]
|
||||
sec = r.get("security_count")
|
||||
total = r.get("upgradable_count")
|
||||
phased = len(r.get("phased_packages") or [])
|
||||
updates = "–" if total is None else f"{total}" + (f" ({sec} sec)" if sec else "")
|
||||
updates_title = ""
|
||||
if phased:
|
||||
updates += f" +{phased} phased"
|
||||
updates_title = (f"{phased} more held back by Ubuntu's phased rollout: not offered to "
|
||||
"this host yet, never security updates")
|
||||
services = services_summary(r)
|
||||
return (
|
||||
"<tr>"
|
||||
@@ -429,7 +435,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
f"<td>{e(r.get('os_pretty_name') or '–')}</td>"
|
||||
f"<td><code>{e(r.get('kernel_running') or '–')}</code></td>"
|
||||
f"<td><code>{e(r.get('kernel_newest_installed') or '–')}</code></td>"
|
||||
f"<td>{e(updates)}</td>"
|
||||
f'<td title="{e(updates_title)}">{e(updates)}</td>'
|
||||
f'<td title="{e(services[1])}">{e(services[0])}</td>'
|
||||
f"<td>{e(duration(r.get('uptime_seconds')))}</td>"
|
||||
f'<td title="{e(utc(h["received_at"]))}">{e(ago(h["received_at"], now))}</td>'
|
||||
@@ -480,6 +486,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
field("Kernel packages upgradable", r.get("kernel_upgradable"), code=True),
|
||||
field("Updates pending", r.get("upgradable_count")),
|
||||
field("Security updates", r.get("security_count")),
|
||||
field("Deferred by phasing", r.get("phased_packages"), code=True),
|
||||
field("Reboot-required packages", r.get("reboot_required_pkgs"), code=True),
|
||||
field("Services needing restart", services_summary(r)[1]),
|
||||
field("Sessions needing restart", r.get("sessions_need_restart")),
|
||||
|
||||
Reference in new issue
Block a user