Skip to content

Commit

Permalink
chore: linting/pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dopheide-esnet committed Aug 9, 2024
1 parent 1b4428a commit 1c63a9c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions zeekclient/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,18 @@ def update_from_args(self, args):
# The `--controller` argument is a shortcut for two `--set` arguments that
# set controller host and port, so update these manually:
if args.controller:
if(":" not in args.controller):
if ":" not in args.controller:
host = args.controller
port = ""
else:
(host, _, port) = args.controller.rpartition(":")
if(host.count(":") > 1):
if host.count(":") > 1:
# We likely have an IPv6 address
if(not host.startswith("[")):
raise ValueError('IPv6 addresses must be surrounded by brackets: [<ipv6>]:<port>')
if(port.endswith("]")):
if not host.startswith("["):
raise ValueError(
"IPv6 addresses must be surrounded by brackets: [<ipv6>]:<port>"
)
if port.endswith("]"):
host = host + ":" + port
port = ""

Expand Down

0 comments on commit 1c63a9c

Please sign in to comment.