X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Finput_data_files.py;fp=resources%2Ftools%2Fpresentation%2Finput_data_files.py;h=00145aa38f0f8b463ab15ccafafd05bc20142fe3;hp=237002f08ba184f67ff5050fce51fd0e406887d9;hb=85785b4fac91e2bc443d4b62b80df418d8a99699;hpb=769f6c8877eb5f4af46a782599acc3d16cf7f35b diff --git a/resources/tools/presentation/input_data_files.py b/resources/tools/presentation/input_data_files.py index 237002f08b..00145aa38f 100644 --- a/resources/tools/presentation/input_data_files.py +++ b/resources/tools/presentation/input_data_files.py @@ -42,7 +42,7 @@ SEPARATOR = u"__" REGEX_RELEASE = re.compile(r'(\D*)(\d{4}|master)(\D*)') -def _download_file(url, file_name, arch=False): +def _download_file(url, file_name, arch=False, verify=True): """Download a file with input data. :param url: URL to the file to download. @@ -90,7 +90,7 @@ def _download_file(url, file_name, arch=False): try: logging.info(f" Connecting to {url} ...") session = requests_retry_session() - response = session.get(url, stream=True, verify=False) + response = session.get(url, stream=True, verify=verify) code = response.status_code logging.info(f" {code}: {responses[code]}") @@ -100,7 +100,7 @@ def _download_file(url, file_name, arch=False): url = url.replace(u"_info", u"") logging.info(f" Connecting to {url} ...") session = requests_retry_session() - response = session.get(url, stream=True, verify=False) + response = session.get(url, stream=True, verify=verify) code = response.status_code logging.info(f" {code}: {responses[code]}") if code != codes[u"OK"]: @@ -119,7 +119,7 @@ def _download_file(url, file_name, arch=False): session.close() logging.info(f" Downloading the file {url} to {file_name} ...") session = requests_retry_session() - response = session.get(url, stream=True, verify=False) + response = session.get(url, stream=True, verify=verify) if response.status_code == codes[u"OK"]: with open(file_name, u"wb") as file_handle: file_handle.write(response.raw.read()) @@ -216,7 +216,9 @@ def download_and_unzip_data_file(spec, job, build, pid): logging.info(f"Trying to download {url}") arch = bool(spec.configuration.get(u"archive-inputs", True)) - success, downloaded_name = _download_file(url, new_name, arch=arch) + success, downloaded_name = _download_file( + url, new_name, arch=arch, verify=False + ) if not success: # Try to download .gz from logs.fd.io