Don't skip an inventory source just because it has a comma (#35002)

* Don't skip an inventory source just because it has a comma, make sure it's also doesn't exist as a path. Fixes #34931

* Add integration test for inventory path with commas
This commit is contained in:
Matt Martz
2018-01-24 09:44:55 -06:00
committed by GitHub
parent 005a8278c6
commit 1ac04ba52e
6 changed files with 18 additions and 1 deletions

View File

@@ -255,7 +255,7 @@ class VariableManager:
''' merges all entities by inventory source '''
data = {}
for inventory_dir in self._inventory._sources:
if ',' in inventory_dir: # skip host lists
if ',' in inventory_dir and not os.path.exists(inventory_dir): # skip host lists
continue
elif not os.path.isdir(inventory_dir): # always pass 'inventory directory'
inventory_dir = os.path.dirname(inventory_dir)