forked from mtusi2026/mtusi2026lab3
8 lines
328 B
Python
8 lines
328 B
Python
import subprocess,sys,time
|
|
for _ in range(90):
|
|
if subprocess.check_output(['docker','inspect','-f','{{.State.Health.Status}}',sys.argv[1]],text=True).strip()=='healthy':
|
|
time.sleep(2) # allow HAProxy rise check and DNS refresh
|
|
break
|
|
time.sleep(1)
|
|
else: raise SystemExit('container did not become ready')
|