mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 19:01:26 -07:00
parent
5babe2daea
commit
6f6bdf7914
12 changed files with 58 additions and 71 deletions
|
@ -113,7 +113,7 @@ patterns = {
|
|||
r'''^
|
||||
(?:{i4}\.){{3}}{i4} # Three parts followed by dots plus one
|
||||
$
|
||||
'''.format(i4=ipv4_component), re.X|re.I
|
||||
'''.format(i4=ipv4_component), re.X | re.I
|
||||
),
|
||||
|
||||
# This matches an IPv6 address, but also permits range expressions.
|
||||
|
@ -143,7 +143,7 @@ patterns = {
|
|||
::(?:ffff:)?(?:{0}\.){{3}}{0}|
|
||||
(?:0:){{5}}ffff:(?:{0}\.){{3}}{0}
|
||||
$
|
||||
'''.format(ipv6_component), re.X|re.I
|
||||
'''.format(ipv6_component), re.X | re.I
|
||||
),
|
||||
|
||||
# This matches a hostname or host pattern including [x:y(:z)] ranges.
|
||||
|
@ -161,11 +161,12 @@ patterns = {
|
|||
{label} # We must have at least one label
|
||||
(?:\.{label})* # Followed by zero or more .labels
|
||||
$
|
||||
'''.format(label=label), re.X|re.I|re.UNICODE
|
||||
'''.format(label=label), re.X | re.I | re.UNICODE
|
||||
),
|
||||
|
||||
}
|
||||
|
||||
|
||||
def parse_address(address, allow_ranges=False):
|
||||
"""
|
||||
Takes a string and returns a (host, port) tuple. If the host is None, then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue