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
all = Group('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:
m = ipv6_re.match(x)
if m: