mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
fix indentation doh
This commit is contained in:
parent
9080745e3a
commit
c092baf9da
1 changed files with 10 additions and 10 deletions
|
@ -1959,15 +1959,15 @@ def parse_host_port(host_port):
|
|||
host, _hostport_separator_, port = _s_.parttion(":")
|
||||
if port:
|
||||
port = int(port)
|
||||
if port and ":" in port:
|
||||
raise ValueError('too many ":" separators in host:port "{}"'.format(host_port))
|
||||
try:
|
||||
host_ip = ipaddress.ip_address(host)
|
||||
host = host_ip
|
||||
except ValueError:
|
||||
log.debug('"%s" Not an IP address? Assuming it is a hostname.', host)
|
||||
except TypeError as _e_:
|
||||
log.error('"%s" generated a TypeError exception', host)
|
||||
raise _e_
|
||||
if port and ":" in port:
|
||||
raise ValueError('too many ":" separators in host:port "{}"'.format(host_port))
|
||||
try:
|
||||
host_ip = ipaddress.ip_address(host)
|
||||
host = host_ip
|
||||
except ValueError:
|
||||
log.debug('"%s" Not an IP address? Assuming it is a hostname.', host)
|
||||
except TypeError as _e_:
|
||||
log.error('"%s" generated a TypeError exception', host)
|
||||
raise _e_
|
||||
|
||||
return host, port
|
||||
|
|
Loading…
Add table
Reference in a new issue