Expose native storage retention for VM and CT backups

This commit is contained in:
Jonatan
2026-10-16 20:32:05 +02:00
parent 3000c1cd66
commit 113659c0e3
11 changed files with 353 additions and 22 deletions
@@ -200,6 +200,10 @@ class CommandDescriptionsTests(unittest.TestCase):
if lang != "en":
messages = json.loads(path.read_text())
english = catalog("en")
# Storage-retention labels await the translation bot. Seed
# only those new leaves in this steady-state fixture.
for key, value in english["backup"]["storageRetention"].items():
messages["backup"].setdefault("storageRetention", {}).setdefault(key, value)
for section, key in (("encryption", "pbsHelp"),
("keyfileActions", "pveKeyDescription")):
messages["backup"][section].setdefault(key, english["backup"][section][key])
@@ -15,7 +15,7 @@ class VmBackupJobsWiring(TestCase):
source = ROUTES.read_text()
routes = re.findall(r'@vm_backup_bp\.route\("([^"]+)", methods=\["(\w+)"\]\)\n@(\w+)\ndef (\w+)', source)
self.assertEqual(len(routes), source.count('@vm_backup_bp.route('))
self.assertEqual(len(routes), 8)
self.assertEqual(len(routes), 10)
for path, method, guard, name in routes:
expected = 'require_auth' if method == 'GET' else 'require_admin_scope'
self.assertEqual(guard, expected, f'{method} {path} ({name})')