(bugfix) Mark retention failures as backup warnings
Add a warning status for BackupRun records so successful snapshots are not reported as failed when post-run SQL retention fails. Keep the prune error in the run result, link the successful snapshot, and let the management command complete with a warning instead of raising a backup failure. Include warning runs in backup trend summaries and add a regression test for successful backups with failed retention cleanup.
This commit is contained in:
@@ -60,5 +60,8 @@ class Command(BaseCommand):
|
||||
if run.status == BackupRun.Status.SUCCESS:
|
||||
self.stdout.write(self.style.SUCCESS(f"Backup completed for {host.host}."))
|
||||
return
|
||||
if run.status == BackupRun.Status.WARNING:
|
||||
self.stdout.write(self.style.WARNING(f"Backup completed with warnings for {host.host}; run id={run.id}"))
|
||||
return
|
||||
|
||||
raise CommandError(f"Backup failed for {host.host}; run id={run.id}")
|
||||
|
||||
Reference in New Issue
Block a user