fix indentation doh

This commit is contained in:
Jeremy McMillan 2019-01-03 22:08:34 -06:00 committed by Pedro Algarvio
parent 9080745e3a
commit c092baf9da

View file

@ -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