1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Minor fix to ipv6 detection for inventory with -i

For link-local addresses, it is sometimes necessary to append the
interface to use for the ipv6 address. This patch extends the ipv6
regex to allow for '%ifnameX' at the end.

See https://bugzilla.redhat.com/show_bug.cgi?id=136852 for more info
This commit is contained in:
James Cammarata 2013-08-19 15:22:44 -05:00
parent b655d5798b
commit 39628d012d

View file

@ -74,7 +74,7 @@ class Inventory(object):
self.parser = None self.parser = None
all = Group('all') all = Group('all')
self.groups = [ all ] self.groups = [ all ]
ipv6_re = re.compile('\[([a-f:A-F0-9]*)\](?::(\d+))?') ipv6_re = re.compile('\[([a-f:A-F0-9]*[%[0-z]+]?)\](?::(\d+))?')
for x in host_list: for x in host_list:
m = ipv6_re.match(x) m = ipv6_re.match(x)
if m: if m: