X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Finput_data_files.py;h=47249b1323beacde9a469b92f7083e12a5404399;hp=8b941f2f94849712534c5d0772ce88be2ce21549;hb=df0263faee6171805e8bc579a4e0a786e63c3a8d;hpb=bb7e8747d67176367fabadac85bc4e2571a47c93 diff --git a/resources/tools/presentation/input_data_files.py b/resources/tools/presentation/input_data_files.py index 8b941f2f94..47249b1323 100644 --- a/resources/tools/presentation/input_data_files.py +++ b/resources/tools/presentation/input_data_files.py @@ -200,11 +200,10 @@ def download_and_unzip_data_file(spec, job, build, pid): :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 ) @@ -219,6 +218,25 @@ def download_and_unzip_data_file(spec, job, build, pid): 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 @@ -260,8 +278,6 @@ def download_and_unzip_data_file(spec, job, build, pid): 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}.")