aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrent Stapleton <brent.stapleton@ettus.com>2018-08-24 10:25:42 -0700
committerBrent Stapleton <bstapleton@g.hmc.edu>2018-08-28 15:04:17 -0700
commit05564d67f061db712a91c3fb64a73b3332c78dab (patch)
tree9eec4d0bac721715203b14808054b2046f921c3a
parent191e250827a54d15abc9f7a5586318a29728d1b0 (diff)
downloaduhd-05564d67f061db712a91c3fb64a73b3332c78dab.tar.gz
uhd-05564d67f061db712a91c3fb64a73b3332c78dab.tar.bz2
uhd-05564d67f061db712a91c3fb64a73b3332c78dab.zip
uhd: utils: Downloader logs no targets selected
uhd_images_downloader: Adding INFO message when there is no target selected to download, as when the user misspells a target name.
-rw-r--r--host/utils/uhd_images_downloader.py.in5
1 files changed, 5 insertions, 0 deletions
diff --git a/host/utils/uhd_images_downloader.py.in b/host/utils/uhd_images_downloader.py.in
index 64a1288e3..96f56e64f 100644
--- a/host/utils/uhd_images_downloader.py.in
+++ b/host/utils/uhd_images_downloader.py.in
@@ -159,11 +159,14 @@ def lookup_urls(regex_l, manifest, inventory, refetch=False):
"""Takes a list of RegExs to match within the manifest, returns a list of tuples with
(hash, URL) that match the targets and are not in the inventory"""
selected_targets = []
+ # Store whether or not we've found a target in the manifest that matches the requested type
+ found_one = False
for target in manifest.keys():
# Iterate through the possible targets in the manifest.
# If any of them match any of the RegExs supplied, add the URL to the
# return list
if all(map((lambda regex: re.findall(regex, target)), regex_l)):
+ found_one = True
log("TRACE", "Selected target: {}".format(target))
target_info = manifest.get(target)
target_url = target_info.get("url")
@@ -181,6 +184,8 @@ def lookup_urls(regex_l, manifest, inventory, refetch=False):
"filename": filename,
"url": target_url,
"sha256_hash": target_sha256})
+ if not found_one:
+ log("INFO", "No targets matching '{}'".format(regex_l))
return selected_targets