From fe34af98cf92c42919ae9dfb06dbf0a13fd53a93 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 7 Aug 2024 17:24:23 +0200 Subject: [PATCH] Continued: - update_nodeinfo() now accepts --force-recrawl and --force-update-none to have both "special" modes separately usable --- fba/boot.py | 4 +++- fba/commands.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fba/boot.py b/fba/boot.py index 7adf5e3..7dc826c 100644 --- a/fba/boot.py +++ b/fba/boot.py @@ -227,7 +227,9 @@ def init_parser(): parser.add_argument("--domain", help="Instance name (aka. domain)") parser.add_argument("--software", help="Name of software, e.g. 'lemmy'") parser.add_argument("--mode", help="Name of detection mode, e.g. 'auto_discovery'") - parser.add_argument("--force-all", action="store_true", help="Forces update of data, no matter what.") + parser.add_argument("--force-all", action="store_true", help="Forces update of data, no matter what. Replaces all force parameters below.") + parser.add_argument("--force-recrawl", action="store_true", help="Forces recrawling all found instances. Can still be limited by --software or any --no-* parameters.") + parser.add_argument("--force-update-none", action="store_true", help="Forces updating 'None' value for software (else it won't be updated).") parser.add_argument("--no-software", action="store_true", help="Checks only entries with no software type detected.") parser.add_argument("--no-auto", action="store_true", help="Checks only entries with other than AUTO_DISCOVERY as detection mode.") parser.add_argument("--no-detection", action="store_true", help="Checks only entries with no detection mode set.") diff --git a/fba/commands.py b/fba/commands.py index b95f044..153f45d 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -1613,7 +1613,7 @@ def update_nodeinfo(args: argparse.Namespace) -> int: elif blacklist.is_blacklisted(row["domain"]): logger.debug("row[domain]='%s' is blacklisted - SKIPPED!", row["domain"]) continue - elif not args.force_all and instances.is_recent(row["domain"], "last_nodeinfo"): + elif not args.force_all and not args.force_recrawl and instances.is_recent(row["domain"], "last_nodeinfo"): logger.debug("row[domain]='%s' has recently been checked - SKIPPED!", row["domain"]) continue @@ -1622,7 +1622,7 @@ def update_nodeinfo(args: argparse.Namespace) -> int: software = federation.determine_software(row["domain"]) logger.debug("Determined software='%s'", software) - if (software != row["software"] and software is not None) or args.force_all is True: + if (software != row["software"] and software is not None) or args.force_all is True or args.force_update_none is True: logger.debug("software='%s'", software) if software is None: logger.debug("Setting nodeinfo_url to 'None' for row[domain]='%s' ...", row["domain"]) -- 2.39.5