|
@@ -13,7 +13,6 @@ from requests.exceptions import SSLError
|
|
|
from requests.packages.urllib3.exceptions import ReadTimeoutError
|
|
from requests.packages.urllib3.exceptions import ReadTimeoutError
|
|
|
|
|
|
|
|
from ..const import API_VERSION_TO_ENGINE_VERSION
|
|
from ..const import API_VERSION_TO_ENGINE_VERSION
|
|
|
-from ..const import HTTP_TIMEOUT
|
|
|
|
|
from .utils import call_silently
|
|
from .utils import call_silently
|
|
|
from .utils import is_mac
|
|
from .utils import is_mac
|
|
|
from .utils import is_ubuntu
|
|
from .utils import is_ubuntu
|
|
@@ -46,7 +45,7 @@ def handle_connection_errors(client):
|
|
|
raise ConnectionError()
|
|
raise ConnectionError()
|
|
|
except RequestsConnectionError as e:
|
|
except RequestsConnectionError as e:
|
|
|
if e.args and isinstance(e.args[0], ReadTimeoutError):
|
|
if e.args and isinstance(e.args[0], ReadTimeoutError):
|
|
|
- log_timeout_error()
|
|
|
|
|
|
|
+ log_timeout_error(client.timeout)
|
|
|
raise ConnectionError()
|
|
raise ConnectionError()
|
|
|
|
|
|
|
|
if call_silently(['which', 'docker']) != 0:
|
|
if call_silently(['which', 'docker']) != 0:
|
|
@@ -66,13 +65,13 @@ def handle_connection_errors(client):
|
|
|
raise ConnectionError()
|
|
raise ConnectionError()
|
|
|
|
|
|
|
|
|
|
|
|
|
-def log_timeout_error():
|
|
|
|
|
|
|
+def log_timeout_error(timeout):
|
|
|
log.error(
|
|
log.error(
|
|
|
"An HTTP request took too long to complete. Retry with --verbose to "
|
|
"An HTTP request took too long to complete. Retry with --verbose to "
|
|
|
"obtain debug information.\n"
|
|
"obtain debug information.\n"
|
|
|
"If you encounter this issue regularly because of slow network "
|
|
"If you encounter this issue regularly because of slow network "
|
|
|
"conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher "
|
|
"conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher "
|
|
|
- "value (current value: %s)." % HTTP_TIMEOUT)
|
|
|
|
|
|
|
+ "value (current value: %s)." % timeout)
|
|
|
|
|
|
|
|
|
|
|
|
|
def log_api_error(e, client_version):
|
|
def log_api_error(e, client_version):
|