expose error in tests

Error Message
object of type 'NoneType' has no len()
Stacktrace
Traceback (most recent call last):
  File "/tmp/kitchen/testing/tests/unit/utils/test_network.py", line 225, in test_parse_host_port
    host, port = network.parse_host_port(host_port)
  File "/tmp/kitchen/testing/salt/utils/network.py", line 1957, in parse_host_port
    raise _e_
TypeError: object of type 'NoneType' has no len()
This commit is contained in:
Jeremy McMillan 2019-01-08 17:43:46 -06:00 committed by Pedro Algarvio
parent 0a92c4691d
commit 02b825ec3c

View file

@ -1969,5 +1969,8 @@ def parse_host_port(host_port):
host = host_ip
except ValueError:
log.debug('"%s" Not an IP address? Assuming it is a hostname.', host)
if host != sanitize_host(host):
log.error('bad hostname: "%s"', host)
raise ValueError('bad hostname: "{}"'.format(host))
return host, port