mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 02:54:26 +00:00
A recent refactor imported baudolo into utils.recovery for three layout strings, and cli.administration.recover.__main__ imports full unconditionally - so the whole recovery CLI, --help included, died at import on every host without baudolo. That is most of them: recover device|nfs|secrets runs on swarm nodes, the NFS server and bare rescue hosts, while only the backup node carries svc-bkp-volume-2-local. utils/recovery had been deliberately stdlib-only for exactly that reason. baudolo 5.0.0 writes a manifest into every generation stating the layout it used, so the names are now asked of the generation being read rather than of the installed package. A tree written by any version is walked with the names that version used, and utils.recovery.layout answers only for generations older than the manifest, which cannot describe themselves. That also retires two of core's guesses: the '<entity>_database' naming convention now yields to the engine the run actually recorded. A repo whose manifest cannot be read is skipped rather than guessed at, but no longer takes the other repos with it - recovering two of three beats recovering none because one manifest is corrupt. The exit code reports the gap. The pin lint compared two declared version strings and was therefore green while a different distribution was installed. It now checks the installed distribution and the layout literals against baudolo's own BackupPaths. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
24 lines
883 B
Python
24 lines
883 B
Python
"""Fallback shape for a generation that cannot state its own.
|
|
|
|
baudolo owns these values and writes them into every generation's manifest, so
|
|
:func:`utils.recovery.manifest.layout_of` is what callers ask. These literals
|
|
answer only for generations written before the manifest existed - those cannot
|
|
describe themselves, and nothing else can tell a reader what they used.
|
|
|
|
Literals rather than an import because the code that reads a generation runs on
|
|
swarm nodes, the NFS server and bare rescue hosts, which carry a git checkout
|
|
and no baudolo; this module must stay import-free for that reason. The
|
|
agreement is enforced by
|
|
``tests/lint/repository/dependencies/test_baudolo_pin.py``.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
SQL_DIR = "sql"
|
|
FILES_DIR = "files"
|
|
DUMP_SUFFIX = ".backup.sql"
|
|
CLUSTER_SUFFIX = ".cluster.backup.sql"
|
|
|
|
MANIFEST_FILE = "manifest.json"
|
|
MANIFEST_SCHEMA = 1
|