mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup.git
synced 2026-09-23 21:23:19 +00:00
feat(manifest)!: record per volume what the run established
A finished generation cannot show whether a volume held a database, nor whether a dump was produced for it: under --only-sql a failed dump falls back to a file copy, and the resulting files/ tree looks like any other copy. The run knows both and threw the knowledge away as a printed warning, leaving every reader to guess from file names. Each generation now carries a manifest.json stating its layout and, per volume, database / dumped / engine. baudolo.generation is the single place those names are spelled; restore/paths.py, backup/db.py and backup/volume.py stop repeating them. It is deliberately import-free so a consumer can read the manifest with nothing but json, on hosts where this package is not installed. BREAKING CHANGE: BackupException is renamed BackupError. The rename is atomic across the ten modules that define or import it, three of which also carry the manifest change, so it lands in this commit rather than a separate one that could not import. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Sequence
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from .shell import BackupException, execute_shell_command
|
||||
from .shell import BackupError, execute_shell_command
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import Sequence
|
||||
|
||||
|
||||
def docker_exec_argv(
|
||||
@@ -34,7 +37,7 @@ def has_tool(container: str, tool: str) -> bool:
|
||||
"""
|
||||
try:
|
||||
execute_shell_command(docker_exec_argv(container, [tool, "--version"]))
|
||||
except BackupException:
|
||||
except BackupError:
|
||||
return False
|
||||
return True
|
||||
|
||||
@@ -74,7 +77,7 @@ def is_swarm_task(container: str) -> bool:
|
||||
container,
|
||||
]
|
||||
)
|
||||
except BackupException:
|
||||
except BackupError:
|
||||
still_listed = execute_shell_command(
|
||||
[
|
||||
"docker",
|
||||
|
||||
Reference in New Issue
Block a user