mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
parsing logic error
This commit is contained in:
parent
98041c1158
commit
1dd1f7dd86
1 changed files with 2 additions and 2 deletions
|
@ -1946,13 +1946,13 @@ def parse_host_port(host_port):
|
|||
_s_ = host_port[:]
|
||||
if _s_[0] == "[":
|
||||
if "]" in host_port[0]:
|
||||
host, _s_ = _s_.lstrip("[]").rsplit("]", 1)
|
||||
host, _s_ = _s_.lstrip("[").rsplit("]", 1)
|
||||
host = ipaddress.IPv6Address(host)
|
||||
if _s_[0] == ":":
|
||||
port = int(_s_.lstrip(":"))
|
||||
else:
|
||||
if len(_s_) > 1:
|
||||
raise ValueError('found ambiguous "{}" port in "{}"'.format(_s_, host_port))
|
||||
host = ipaddress.IPv6Address(host)
|
||||
else:
|
||||
if _s_.count(":") == 1:
|
||||
host, _hostport_separator_, port = _s_.partition(":")
|
||||
|
|
Loading…
Add table
Reference in a new issue