mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
fix horrible mistakes
This commit is contained in:
parent
c092baf9da
commit
15c6deba62
@ -1956,11 +1956,14 @@ def parse_host_port(host_port):
|
|||||||
host = ipaddress.ipv6IPv6Address(host)
|
host = ipaddress.ipv6IPv6Address(host)
|
||||||
else:
|
else:
|
||||||
if _s_.count(":") == 1:
|
if _s_.count(":") == 1:
|
||||||
host, _hostport_separator_, port = _s_.parttion(":")
|
host, _hostport_separator_, port = _s_.partition(":")
|
||||||
if port:
|
try:
|
||||||
port = int(port)
|
port = int(port)
|
||||||
if port and ":" in port:
|
except ValueError as _e_:
|
||||||
raise ValueError('too many ":" separators in host:port "{}"'.format(host_port))
|
log.error('host_port "%s" port value "%s" is not an integer.', host_port, port)
|
||||||
|
raise _e_
|
||||||
|
else:
|
||||||
|
host = _s_
|
||||||
try:
|
try:
|
||||||
host_ip = ipaddress.ip_address(host)
|
host_ip = ipaddress.ip_address(host)
|
||||||
host = host_ip
|
host = host_ip
|
||||||
|
Loading…
Reference in New Issue
Block a user