help="Fetches CSV files (block recommendations) for more possible instances to disover",
)
parser.set_defaults(command=commands.fetch_csv)
+ parser.add_argument("--domain", help="Instance name (aka. domain) to check")
### Fetch instances from given initial instance ###
parser = subparser_command.add_parser(
logger.info("Checking %d CSV files ...", len(blocklists.csv_files))
for block in blocklists.csv_files:
logger.debug("block[blocker]='%s',block[csv_url]='%s'", block["blocker"], block["csv_url"])
+
+ # Is domain given and not equal blocker?
+ if isinstance(args.domain, str) and args.domain != block["blocker"]:
+ logger.debug("Skipping blocker='%s', not matching args.domain='%s'", block["blocker"], args.domain)
+ continue
+
+ logger.debug("Invoking processing.csv_block(%s, %s, fetch_csv) ...", block["blocker"], block["csv_url"])
processing.csv_block(block["blocker"], block["csv_url"], inspect.currentframe().f_code.co_name)
logger.debug("Success - EXIT!")
logger.debug("Skipping blocker='%s', not matching args.domain='%s'", block["blocker"], args.domain)
continue
- processing.csv_block(block["blocker"], f"{base_url}/{block['csv_url']}", inspect.currentframe().f_code.co_name)
+ url = f"{base_url}/{block['csv_url']}"
+
+ logger.debug("Invoking processing.csv_block(%s, %s, fetch_oliphant) ...", block["blocker"], url)
+ processing.csv_block(block["blocker"], url, inspect.currentframe().f_code.co_name)
logger.debug("Success! - EXIT!")
return 0