forked from mtusi2026/mtusi2026lab4
15 lines
601 B
Python
15 lines
601 B
Python
#!/usr/bin/env python3
|
|
"""Pause the normal cron worker for deterministic faults, always restore it."""
|
|
from pathlib import Path
|
|
import subprocess
|
|
|
|
ROOT=Path(__file__).resolve().parents[1]
|
|
COMPOSE=str(ROOT/'scripts/compose.sh')
|
|
subprocess.run([COMPOSE,'stop','reconciler'],cwd=ROOT,check=True)
|
|
try:
|
|
output=subprocess.check_output([COMPOSE,'run','--rm','-T','--no-deps','ops','python','scripts/research_consistency.py'],cwd=ROOT,text=True)
|
|
(ROOT/'evidence/reconciliation.json').write_text(output)
|
|
print(output)
|
|
finally:
|
|
subprocess.run([COMPOSE,'start','reconciler'],cwd=ROOT,check=True)
|