Flag hosts where unattended-upgrades has stopped succeeding
On a host with unattended-upgrades enabled, no successful run in
unattended_upgrades_stale_after_days (default 3, 0 disables) puts it in
update. The reason says which way it broke: still running but failing
("last succeeded 5d ago and is failing (last ran 6h ago); check
/var/log/unattended-upgrades/"), not running at all ("is
apt-daily-upgrade.timer enabled?"), or never succeeded. A host where it
hasn't completed its first run yet gets a note, and packages it keeps back
are noted. Hosts with it disabled or not installed, and agents before
0.8.0, are judged as before. The host page shows the state, both stamp
ages and the kept-back packages.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
df097c9da3
commit
bfac723850
7 files changed
+143
No files matched your search
@@ -108,6 +108,15 @@ class ConfigTest(unittest.TestCase):
|
||||
with self.subTest(bad=bad), self.assertRaises(SystemExit):
|
||||
config.load(self.write(tmp, f"os_eol_warn_days = {bad}\n"))
|
||||
|
||||
def test_unattended_upgrades_stale_days_validated(self):
|
||||
with tempdir() as tmp:
|
||||
self.assertEqual(config.Config().unattended_upgrades_stale_after_days, 3.0)
|
||||
self.assertEqual(config.load(self.write(tmp, "unattended_upgrades_stale_after_days = 0\n"))
|
||||
.unattended_upgrades_stale_after_days, 0)
|
||||
for bad in ("-1", "inf", "nan", '"3"'):
|
||||
with self.subTest(bad=bad), self.assertRaises(SystemExit):
|
||||
config.load(self.write(tmp, f"unattended_upgrades_stale_after_days = {bad}\n"))
|
||||
|
||||
def test_fallback_parser_matches_tomllib(self):
|
||||
"""Python 3.10 has no tomllib; the fallback must read the same configs."""
|
||||
if config.tomllib is None:
|
||||
|
||||
Reference in new issue
Block a user