Merge pull request #7412 from bellkev/fix_skip_dir_inventory_extensions

Fix skip dir inventory extensions
This commit is contained in:
James Cammarata
2014-05-19 23:14:22 -05:00
3 changed files with 9 additions and 4 deletions

View File

@@ -36,13 +36,12 @@ class InventoryDirectory(object):
self.parsers = []
self.hosts = {}
self.groups = {}
for i in self.names:
# Skip files that end with certain extensions or characters
for ext in ("~", ".orig", ".bak", ".ini", ".retry", ".pyc", ".pyo"):
if i.endswith(ext):
continue
if any(i.endswith(ext) for ext in ("~", ".orig", ".bak", ".ini", ".retry", ".pyc", ".pyo")):
continue
# Skip hidden files
if i.startswith('.') and not i.startswith('./'):
continue