try:
logging.info(f" Connecting to {url} ...")
session = requests_retry_session()
- response = session.get(url, stream=True)
+ response = session.get(url, stream=True, verify=False)
code = response.status_code
logging.info(f" {code}: {responses[code]}")
url = url.replace(u"_info", u"")
logging.info(f" Connecting to {url} ...")
session = requests_retry_session()
- response = session.get(url, stream=True)
+ response = session.get(url, stream=True, verify=False)
code = response.status_code
logging.info(f" {code}: {responses[code]}")
if code != codes[u"OK"]:
session.close()
logging.info(f" Downloading the file {url} to {file_name} ...")
session = requests_retry_session()
- response = session.get(url, stream=True)
+ response = session.get(url, stream=True, verify=False)
if response.status_code == codes[u"OK"]:
with open(file_name, u"wb") as file_handle:
file_handle.write(response.raw.read())
:rtype: bool
"""
- # Try to download .gz from logs.fd.io
-
+ # Try to download .gz from s3_storage
file_name = spec.input[u"file-name"]
url = u"{0}/{1}".format(
- spec.environment[u'urls'][u'URL[NEXUS,LOG]'],
+ spec.environment[u'urls'][u'URL[S3_STORAGE,LOG]'],
spec.input[u'download-path'].format(
job=job, build=build[u'build'], filename=file_name
)
arch = bool(spec.configuration.get(u"archive-inputs", True))
success, downloaded_name = _download_file(url, new_name, arch=arch)
+ if not success:
+ # Try to download .gz from logs.fd.io
+ file_name = spec.input[u"file-name"]
+ url = u"{0}/{1}".format(
+ spec.environment[u'urls'][u'URL[NEXUS,LOG]'],
+ spec.input[u'download-path'].format(
+ job=job, build=build[u'build'], filename=file_name
+ )
+ )
+ new_name = join(
+ spec.environment[u"paths"][u"DIR[WORKING,DATA]"],
+ f"{job}{SEPARATOR}{build[u'build']}{SEPARATOR}{file_name}"
+ )
+
+ 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)
+
if not success:
# Try to download .gz or .zip from docs.fd.io
download_path = spec.input[u"zip-download-path"]
if job.startswith(u"csit-"):
url = spec.environment[u"urls"][u"URL[JENKINS,CSIT]"]
- elif job.startswith(u"hc2vpp-"):
- url = spec.environment[u"urls"][u"URL[JENKINS,HC]"]
else:
raise PresentationError(f"No url defined for the job {job}.")