- if job.startswith("csit-"):
- if spec.input["file-name"].endswith(".zip"):
- url = spec.environment["urls"]["URL[JENKINS,CSIT]"]
- elif spec.input["file-name"].endswith(".gz"):
- url = spec.environment["urls"]["URL[NEXUS,LOG]"]
- else:
- log.append(("ERROR", "Not supported file format."))
- return False
- elif job.startswith("hc2vpp-"):
- url = spec.environment["urls"]["URL[JENKINS,HC]"]
- elif job.startswith("intel-dnv-"):
- url = spec.environment["urls"]["URL[VIRL,DNV]"].format(release=job[-4:])
- else:
- raise PresentationError("No url defined for the job '{}'.".format(job))
- file_name = spec.input["file-name"]
- full_name = spec.input["download-path"]. \
- format(job=job, build=build["build"], filename=file_name)
- if not job.startswith("intel-dnv-"):
- url = "{0}/{1}".format(url, full_name)
- new_name = join(spec.environment["paths"]["DIR[WORKING,DATA]"],
- "{job}{sep}{build}{sep}{name}".
- format(job=job, sep=SEPARATOR, build=build["build"],
- name=file_name))
-
- # Download the file from the defined source (Jenkins, logs.fd.io):
- success, downloaded_name = _download_file(url, new_name, log)
- if success:
- new_name = downloaded_name