From 4caf85e37bdff284c337086ff3ce46b1dcfd8751 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Mon, 27 Aug 2012 21:49:12 -0400 Subject: [PATCH] Fix --limit for external inventory scripts, slight variant on fix from pull #949 --- lib/ansible/inventory/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ansible/inventory/__init__.py b/lib/ansible/inventory/__init__.py index 3099bd8d1b..6e83064f83 100644 --- a/lib/ansible/inventory/__init__.py +++ b/lib/ansible/inventory/__init__.py @@ -114,11 +114,11 @@ class Inventory(object): positive_subsetp = [ p for p in self._subset if not p.startswith("!") ] negative_subsetp = [ p for p in self._subset if p.startswith("!") ] if len(positive_subsetp): - positive_subset = self._get_hosts(positive_subsetp) - hosts = [ h for h in hosts if (h in positive_subset) ] + positive_subset = [ h.name for h in self._get_hosts(positive_subsetp) ] + hosts = [ h for h in hosts if (h.name in positive_subset) ] if len(negative_subsetp): - negative_subset = self._get_hosts(negative_subsetp) - hosts = [ h for h in hosts if (h not in negative_subset)] + negative_subset = [ h.name for h in self._get_hosts(negative_subsetp) ] + hosts = [ h for h in hosts if (h.name not in negative_subset)] # exclude hosts mentioned in any restriction (ex: failed hosts) if self._restriction is not None: