mirror of
https://github.com/domainaware/parsedmarc.git
synced 2026-03-21 05:55:59 +00:00
Compare commits
2 Commits
config-rel
...
copilot/su
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3509e5c553 | ||
|
|
964a1baeed |
@@ -832,6 +832,13 @@ def _init_output_clients(opts):
|
||||
Raises:
|
||||
ConfigurationError: If a required output client cannot be created.
|
||||
"""
|
||||
# Validate all required settings before creating any clients so that a
|
||||
# ConfigurationError does not leave partially-created clients un-closed.
|
||||
if opts.hec and (opts.hec_token is None or opts.hec_index is None):
|
||||
raise ConfigurationError(
|
||||
"HEC token and HEC index are required when using HEC URL"
|
||||
)
|
||||
|
||||
clients = {}
|
||||
|
||||
if opts.save_aggregate or opts.save_forensic or opts.save_smtp_tls:
|
||||
@@ -940,10 +947,6 @@ def _init_output_clients(opts):
|
||||
)
|
||||
|
||||
if opts.hec:
|
||||
if opts.hec_token is None or opts.hec_index is None:
|
||||
raise ConfigurationError(
|
||||
"HEC token and HEC index are required when using HEC URL"
|
||||
)
|
||||
verify = True
|
||||
if opts.hec_skip_certificate_verification:
|
||||
verify = False
|
||||
|
||||
Reference in New Issue
Block a user