mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 16:14:40 +00:00
unbound: dnsbl_module: (test-mode) assume a query can pass if a blocklist file is empty
This commit is contained in:
parent
a6268ecc27
commit
41728b7901
@ -562,6 +562,10 @@ def arg_parse_is_json_file(filename):
|
||||
json.load(open(filename))
|
||||
except FileNotFoundError:
|
||||
raise argparse.ArgumentTypeError("non existing file")
|
||||
except json.JSONDecodeError:
|
||||
# in cases where a file exists, but we're unable to decode it (e.g. the file is empty),
|
||||
# we should assume the blocklist has no entries.
|
||||
pass
|
||||
except:
|
||||
raise argparse.ArgumentTypeError("No blocklist available")
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user