From: Roland Häder Date: Sat, 7 Sep 2024 17:14:20 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3fcd59e81a6738de965edcdcd51195d06979355f;p=fba.git Continued: - when returned value from tidyup.domain() is an empty string or None then always log it as a debug message --- diff --git a/fba/commands.py b/fba/commands.py index 66af1ff..d9b04dc 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -849,8 +849,8 @@ def fetch_fba_rss(args: argparse.Namespace) -> int: logger.debug("item[%s]='%s'", type(item), item) domain = item.link.split("=")[1] domain = tidyup.domain(domain) if domain not in[None, ""] else None - logger.debug("domain='%s' - AFTER!", domain) + if domain in [None, ""]: logger.debug("domain[%s]='%s' is empty after tidyup.domain() - SKIPPED!", type(domain), domain) continue @@ -936,8 +936,8 @@ def fetch_fbabot_atom(args: argparse.Namespace) -> int: for href in element["href"].split(","): logger.debug("href[%s]='%s' - BEFORE!", type(href), href) domain = tidyup.domain(href) if href not in [None, ""] else None - logger.debug("domain='%s' - AFTER!", domain) + if domain in [None, ""]: logger.debug("domain[%s]='%s' is empty after tidyup.domain(): href='%s' - SKIPPED!", type(domain), domain, href) continue @@ -1206,8 +1206,8 @@ def fetch_fedipact(args: argparse.Namespace) -> int: for row in rows: logger.debug("row[]='%s'", type(row)) domain = tidyup.domain(row.contents[0]) if row.contents[0] not in [None, ""] else None - logger.debug("domain='%s' - AFTER!", domain) + if domain in [None, ""]: logger.debug("domain[%s]='%s' is empty after tidyup.domain(): row.contents[0]='%s' - SKIPPED!", type(domain), domain, row.contents[0]) continue diff --git a/fba/http/federation.py b/fba/http/federation.py index 71f0d57..98afd1c 100644 --- a/fba/http/federation.py +++ b/fba/http/federation.py @@ -165,7 +165,7 @@ def fetch_instances(domain: str, origin: str, software: str, command: str, path: logger.debug("instance='%s' - AFTER!", instance) if instance in [None, ""]: - logger.warning("instance[%s]='%s' is empty after tidyup.domain(), domain='%s'", type(instance), instance, domain) + logger.debug("instance[%s]='%s' is empty after tidyup.domain(), domain='%s'", type(instance), instance, domain) continue elif ".." in instance: logger.warning("instance='%s' contains double-dot, removing ...", instance) diff --git a/fba/networks/lemmy.py b/fba/networks/lemmy.py index d16bf6c..c97932f 100644 --- a/fba/networks/lemmy.py +++ b/fba/networks/lemmy.py @@ -215,7 +215,7 @@ def fetch_blocks(domain: str) -> list: logger.debug("blocked='%s'", blocked) if blocked in [None, ""]: - logger.warning("blocked[%s]='%s' is empty after tidyup.domain(): tag.contents[0]='%s' - SKIPPED!", type(blocked), blocked, tag.contents[0]) + logger.debug("blocked[%s]='%s' is empty after tidyup.domain(): tag.contents[0]='%s' - SKIPPED!", type(blocked), blocked, tag.contents[0]) continue elif not domain_helper.is_wanted(blocked): logger.debug("blocked='%s' is not wanted - SKIPPED!", blocked) diff --git a/fba/networks/pleroma.py b/fba/networks/pleroma.py index 27956b3..981e68d 100644 --- a/fba/networks/pleroma.py +++ b/fba/networks/pleroma.py @@ -126,7 +126,7 @@ def fetch_blocks(domain: str) -> list: logger.debug("blocked='%s' - AFTER!", blocked) if blocked in [None, ""]: - logger.warning("blocked[%s]='%s' is empty after tidyup.domain(): domain='%s',block_level='%s' - SKIPPED!", type(blocked), blocked, domain, block_level) + logger.debug("blocked[%s]='%s' is empty after tidyup.domain(): domain='%s',block_level='%s' - SKIPPED!", type(blocked), blocked, domain, block_level) continue elif validators.domain(blocked, rfc_2782=True) and blacklist.is_blacklisted(blocked): logger.debug("blocked='%s' is blacklisted - SKIPPED!") @@ -155,7 +155,7 @@ def fetch_blocks(domain: str) -> list: logger.debug("blocked='%s' - AFTER!", blocked) if blocked in [None, ""]: - logger.warning("blocked[%s]='%s' is empty after tidyup.domain(): domain='%s',block_level='%s'", type(blocked), blocked, domain, block_level) + logger.debug("blocked[%s]='%s' is empty after tidyup.domain(): domain='%s',block_level='%s'", type(blocked), blocked, domain, block_level) continue elif not domain_helper.is_wanted(blocked): logger.debug("blocked='%s' is not wanted - SKIPPED!", blocked) @@ -216,7 +216,7 @@ def fetch_blocks(domain: str) -> list: logger.debug("blocked='%s',reason='%s' - AFTER!", blocked, reason) if blocked in [None, ""]: - logger.warning("blocked[%s]='%s' is empty after tidyup.domain(): domain='%s',block_level='%s'", type(blocked), blocked, domain, block_level) + logger.debug("blocked[%s]='%s' is empty after tidyup.domain(): domain='%s',block_level='%s'", type(blocked), blocked, domain, block_level) continue logger.debug("Checking %d blockdict records ...", len(blockdict)) @@ -240,7 +240,7 @@ def fetch_blocks(domain: str) -> list: logger.debug("cleaned='%s',reason='%s' - AFTER!", cleaned, reason) if cleaned in [None, ""]: - logger.warning("cleaned[%s]='%s' is empty after tidyup.domain(): domain='%s',block_level='%s'", type(cleaned), cleaned, domain, block_level) + logger.debug("cleaned[%s]='%s' is empty after tidyup.domain(): domain='%s',block_level='%s'", type(cleaned), cleaned, domain, block_level) continue elif blocked not in rows: logger.warning("Cannot find blocked='%s' in rows()=%d: domain='%s',block_level='%s'", blocked,len(rows), domain, block_level)