File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 45
45
import stat
46
46
import subprocess
47
47
import sys
48
+ import time
48
49
49
50
import yaml
50
51
@@ -451,11 +452,15 @@ def acquire(self) -> AcquiredFrom:
451
452
acquired_from: How the image was acquired.
452
453
"""
453
454
if self .image .publish :
454
- try :
455
- spawn .runv (["docker" , "pull" , self .spec ()])
456
- return AcquiredFrom .REGISTRY
457
- except subprocess .CalledProcessError :
458
- pass
455
+ while True :
456
+ try :
457
+ spawn .runv (["docker" , "pull" , self .spec ()])
458
+ return AcquiredFrom .REGISTRY
459
+ except subprocess .CalledProcessError :
460
+ if not ui .env_is_truthy ("MZBUILD_WAIT_FOR_IMAGE" ):
461
+ break
462
+ print (f"waiting for mzimage to become available" , file = sys .stderr )
463
+ time .sleep (10 )
459
464
self .build ()
460
465
return AcquiredFrom .LOCAL_BUILD
461
466
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ def shell_quote(args: Iterable[Any]) -> str:
107
107
108
108
109
109
def env_is_truthy (env_var : str ) -> bool :
110
- """Return true if `env_var` is set and is not one of: 0, n , no"""
110
+ """Return true if `env_var` is set and is not one of: 0, '' , no"""
111
111
env = os .getenv (env_var )
112
112
if env is not None :
113
113
return env not in ("" , "0" , "no" )
You can’t perform that action at this time.
0 commit comments