mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07: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:
parent
593d80c63d
commit
75e94e0cba
5 changed files with 49 additions and 29 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue