Merge "Armada timeout adjustment"

This commit is contained in:
Zuul 2023-05-16 19:27:54 +00:00 committed by Gerrit Code Review
commit fa0af775d5
4 changed files with 5 additions and 3 deletions

View File

@ -19,6 +19,7 @@ from oslo_log import log as logging
from armada import api
from armada.common import policy
CONF = cfg.CONF
LOG = logging.getLogger(__name__)

View File

@ -110,7 +110,8 @@ class GitTestCase(base.ArmadaTestCase):
source.download_tarball(url)
mock_temp.mkstemp.assert_called_once()
mock_requests.get.assert_called_once_with(url, timeout=5, verify=False)
mock_requests.get.assert_called_once_with(
url, timeout=None, verify=False)
mock_open.assert_called_once_with('/tmp/armada', 'wb')
mock_open().write.assert_called_once_with(
mock_requests.get(url).content)

View File

@ -135,7 +135,7 @@ def download_tarball(tarball_url, verify=False, proxy_server=None):
}
tarball_filename = tempfile.mkstemp(prefix='armada')[1]
response = requests.get(
tarball_url, timeout=5, verify=verify, **kwargs)
tarball_url, timeout=None, verify=verify, **kwargs)
with open(tarball_filename, 'wb') as f:
f.write(response.content)

View File

@ -177,6 +177,6 @@ def validate_armada_documents(documents):
def validate_manifest_url(value):
try:
return (requests.get(value, timeout=5).status_code == 200)
return (requests.get(value, timeout=None).status_code == 200)
except requests.exceptions.RequestException:
return False