From 8371f8b37bc2192bd412206402e9ebd3650cc943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <h.tomwoerden@indiscale.com> Date: Wed, 10 Jul 2024 09:16:01 +0200 Subject: [PATCH] MAINT: make sure domain var is set --- src/caoscrawler/crawl.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/caoscrawler/crawl.py b/src/caoscrawler/crawl.py index dab9fbba..2d796bf9 100644 --- a/src/caoscrawler/crawl.py +++ b/src/caoscrawler/crawl.py @@ -761,8 +761,8 @@ one with the entities that need to be updated and the other with entities to be filename=filename, changes="\n".join([el[3] for el in pending_changes])) try: - fro=get_config_setting("sendmail_from_address") - to=get_config_setting("sendmail_to_address") + fro = get_config_setting("sendmail_from_address") + to = get_config_setting("sendmail_to_address") except KeyError: logger.error("Server Configuration is missing a setting for " "sending mails. The administrator should check " @@ -895,8 +895,8 @@ the CaosDB Crawler successfully crawled the data and """ + domain = get_config_setting("public_host_url") if get_config_setting("create_crawler_status_records"): - domain = get_config_setting("public_host_url") text += ("You can checkout the CrawlerRun Record for more information:\n" f"{domain}/Entity/?P=0L10&query=find%20crawlerrun%20with%20run_id=%27{run_id}%27\n\n") text += (f"You can download the logfile here:\n{domain}/Shared/" + logfile) @@ -1082,6 +1082,8 @@ def crawler_main(crawled_directory_path: str, ident = CaosDBIdentifiableAdapter() ident.load_from_yaml_definition(identifiables_definition_file) crawler.identifiableAdapter = ident + else: + raise ValueError("An identifiable file is needed.") remove_prefix = _treat_deprecated_prefix(prefix, remove_prefix) -- GitLab