From 97131c23e8bddac4b2455e84f8bd38880cd688ea Mon Sep 17 00:00:00 2001
From: Alan De Smet <alan.desmet@ssec.wisc.edu>
Date: Mon, 16 Aug 2021 15:06:01 -0500
Subject: [PATCH] download_for_scan returns list of final files
---
csppfetch/__init__.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/csppfetch/__init__.py b/csppfetch/__init__.py
index 086ea7c..374505a 100644
--- a/csppfetch/__init__.py
+++ b/csppfetch/__init__.py
@@ -781,6 +781,8 @@ class Downloader:
statistics
:type download_stats: None or csppfetch.DownloadStatistics
+ :return: list of strings to downloaded files
+
"""
base_urls = self.get_base_urls()
@@ -817,7 +819,7 @@ class Downloader:
# since any exceptions will retry downloads
# when we already have the files!
pass
- return True
+ return full_urls_to_file.values()
except Exception as e:
problems.append(f"Failed to download file set {description}: {str(e)}")
if attempt != retries:
@@ -850,6 +852,8 @@ class Downloader:
download statistics
:type download_stats: None or csppfetch.DownloadStatistics
+ :return: list of strings to downloaded files
+
**timeout**, **retries**, and **retry_wait** are overriddeen by environment
variables ``package_env_id+TIMEOUT/RETRIES/RETRY_WAIT``
@@ -860,7 +864,7 @@ class Downloader:
timeout = self.get_timeout(timeout)
retries = self.get_retries(retries)
retry_wait = self.get_retry_wait(retry_wait)
- self.download_first_available(filesets, dst, timeout=timeout, retries=retries, retry_wait=retry_wait, do_download = do_download, download_stats = download_stats)
+ return self.download_first_available(filesets, dst, timeout=timeout, retries=retries, retry_wait=retry_wait, do_download = do_download, download_stats = download_stats)
def update_cache(self, dst, start_time=None, end_time=None, timeout=30, download_stats=None):
--
GitLab