From e36a8d466e5ace049a18334f9ee4c07cc44bfb91 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Mon, 19 May 2014 16:39:47 -0500 Subject: [PATCH] Don't re-query inventory when trimming failed/dark hosts Since the filter list contains hosts, passing that back to list_hosts() in the inventoy causes issues when the hostname is an IPv6 address (with :'s interpreted as group unions). Since we already have the list of hosts, we should not need to pass that back through inventory a second time. Fixes #7446 --- lib/ansible/playbook/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/playbook/__init__.py b/lib/ansible/playbook/__init__.py index 525e10efec..5eba7745c8 100644 --- a/lib/ansible/playbook/__init__.py +++ b/lib/ansible/playbook/__init__.py @@ -348,7 +348,7 @@ class PlayBook(object): def _trim_unavailable_hosts(self, hostlist=[]): ''' returns a list of hosts that haven't failed and aren't dark ''' - return [ h for h in self.inventory.list_hosts(hostlist) if (h not in self.stats.failures) and (h not in self.stats.dark)] + return [ h for h in hostlist if (h not in self.stats.failures) and (h not in self.stats.dark)] # *****************************************************