mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
allow for non standard hostnames
* Changed parse_addresses to throw exceptions instead of passing None * Switched callers to trap and pass through the original values. * Added very verbose notice * Look at deprecating this and possibly validate at plugin instead fixes #13608
This commit is contained in:
@@ -71,7 +71,12 @@ class TestParseAddress(unittest.TestCase):
|
||||
for t in self.tests:
|
||||
test = self.tests[t]
|
||||
|
||||
(host, port) = parse_address(t)
|
||||
try:
|
||||
(host, port) = parse_address(t)
|
||||
except:
|
||||
host = None
|
||||
port = None
|
||||
|
||||
assert host == test[0]
|
||||
assert port == test[1]
|
||||
|
||||
@@ -79,6 +84,11 @@ class TestParseAddress(unittest.TestCase):
|
||||
for t in self.range_tests:
|
||||
test = self.range_tests[t]
|
||||
|
||||
(host, port) = parse_address(t, allow_ranges=True)
|
||||
try:
|
||||
(host, port) = parse_address(t, allow_ranges=True)
|
||||
except:
|
||||
host = None
|
||||
port = None
|
||||
|
||||
assert host == test[0]
|
||||
assert port == test[1]
|
||||
|
||||
Reference in New Issue
Block a user