From 39628d012ddf1bd31799b1b140971e50965aaa28 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Mon, 19 Aug 2013 15:22:44 -0500 Subject: [PATCH] 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 --- lib/ansible/inventory/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/inventory/__init__.py b/lib/ansible/inventory/__init__.py index 228d3b7210..3a8bce6d77 100644 --- a/lib/ansible/inventory/__init__.py +++ b/lib/ansible/inventory/__init__.py @@ -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: