Files
mtusi2026lab7/scripts/wait_ready.py
T
ferraronp ca7515601a
Skeleton contracts / contracts (pull_request) Blocked by required conditions
feat: реализовать ЛР7 — TLS, mTLS, OpenBao и hardening
2026-11-26 19:50:38 +03:00

15 lines
452 B
Python

"""Operator-facing readiness wait after container replacement."""
import time
import urllib.request
for _ in range(120):
try:
with urllib.request.urlopen("http://localhost:8080/health/ready", timeout=2) as response:
if response.status == 200:
print("[restart] all services ready")
break
except Exception:
pass
time.sleep(.5)
else:
raise SystemExit("[restart] health timeout")