feat: discover snapshots into Django records
Add a Django-native snapshot discovery service and management command that scans backup directories, reads snapshot metadata, and idempotently upserts SnapshotRecord rows. Expose it through the pobsync command wrapper, update admin/docs, and cover discovery behavior with tests.
This commit is contained in:
@@ -39,3 +39,10 @@ class ConsoleEntrypointTests(SimpleTestCase):
|
||||
execute.assert_called_once_with(
|
||||
["pobsync", "configure_pobsync_schedule", "web-01", "--cron", "15 2 * * *"]
|
||||
)
|
||||
|
||||
def test_maps_discover_snapshots_alias_to_django_command(self) -> None:
|
||||
with patch("pobsync.cli.execute_from_command_line") as execute:
|
||||
exit_code = main(["discover-snapshots", "--host", "web-01"])
|
||||
|
||||
self.assertEqual(exit_code, 0)
|
||||
execute.assert_called_once_with(["pobsync", "discover_pobsync_snapshots", "--host", "web-01"])
|
||||
|
||||
Reference in New Issue
Block a user