File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313import docker .constants
1414from docker .auth import auth
1515from docker .errors import APIError
16+ import requests
1617
1718logger = logging .getLogger (__name__ )
1819
@@ -173,10 +174,14 @@ def check_blacklist(repo):
173174
174175def log_output (stream , operation , repo , tag ):
175176 """Log a stream at DEBUG level, and raise RegistryException if it contains an error"""
176- for chunk in stream :
177- # error handling requires looking at the response body
178- if 'error' in chunk :
179- stream_error (chunk , operation , repo , tag )
177+ try :
178+ for chunk in stream :
179+ # error handling requires looking at the response body
180+ if 'error' in chunk :
181+ stream_error (chunk , operation , repo , tag )
182+ except requests .packages .urllib3 .exceptions .ReadTimeoutError as e :
183+ message = 'Operation {} timed out for image {}:{}' .format (operation , repo , tag )
184+ raise RegistryException (message ) from e
180185
181186
182187def stream_error (chunk , operation , repo , tag ):
You can’t perform that action at this time.
0 commit comments