From 7bcc1db030fc7b2f75c0147284ece820abb08144 Mon Sep 17 00:00:00 2001 From: Moras-del Date: Thu, 13 Aug 2020 19:10:13 +0200 Subject: [PATCH] fixed missing_sites --- sherlock/sherlock.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sherlock/sherlock.py b/sherlock/sherlock.py index 68cad49c..7677ba1b 100644 --- a/sherlock/sherlock.py +++ b/sherlock/sherlock.py @@ -557,16 +557,19 @@ def main(): site_data = {} site_missing = [] for site in args.site_list: + counter = 0 for existing_site in site_data_all: if site.lower() == existing_site.lower(): site_data[existing_site] = site_data_all[existing_site] - if not site_data: + counter += 1 + if counter == 0: # Build up list of sites not supported for future error message. site_missing.append(f"'{site}'") if site_missing: - print( - f"Error: Desired sites not found: {', '.join(site_missing)}.") + print(f"Error: Desired sites not found: {', '.join(site_missing)}.") + + if not site_data: sys.exit(1) #Create notify object for query results.