Spaces:
Sleeping
Sleeping
| #!/usr/bin/env python3 | |
| """Fail-fast startup configuration gate for the deployed overlay.""" | |
| from __future__ import annotations | |
| import sys | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| for candidate in (ROOT / "hermes_overlay", Path("/opt/hermesface_overlay"), Path("/opt/hermes")): | |
| if candidate.is_dir(): | |
| sys.path.insert(0, str(candidate)) | |
| from trading.config_validation import ConfigurationError, assert_safe_for_startup # noqa: E402 | |
| def main() -> int: | |
| try: | |
| assert_safe_for_startup() | |
| except ConfigurationError as exc: | |
| print(f"ERROR: unsafe startup configuration: {exc}", file=sys.stderr) | |
| return 1 | |
| print("startup_configuration=PASS") | |
| return 0 | |
| if __name__ == "__main__": | |
| raise SystemExit(main()) | |