Don't raise if there is no matching entry

parent 86264fb8
...@@ -198,6 +198,7 @@ def helper_download_network_cached(dir_url, cache_url, ...@@ -198,6 +198,7 @@ def helper_download_network_cached(dir_url, cache_url,
matching_entry_list.append(tags) matching_entry_list.append(tags)
except Exception: except Exception:
pass pass
if matching_entry_list:
# If a strategy is defined, call it to determine best entry # If a strategy is defined, call it to determine best entry
if strategy: if strategy:
best_entry = strategy(matching_entry_list) best_entry = strategy(matching_entry_list)
...@@ -210,8 +211,6 @@ def helper_download_network_cached(dir_url, cache_url, ...@@ -210,8 +211,6 @@ def helper_download_network_cached(dir_url, cache_url,
# download best entry # download best entry
file_descriptor = nc.download(best_entry.get('sha512')) file_descriptor = nc.download(best_entry.get('sha512'))
if file_descriptor is not None:
return file_descriptor, tags return file_descriptor, tags
else: else:
logger.info('No matching entry to download from network cache: %s'\ logger.info('No matching entry to download from network cache: %s'\
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment