Fixed extension filtering in InventoryDirectory

pull/7527/head
Kevin Bell 11 years ago committed by James Cammarata
parent d6214c5d56
commit 2432b45eb1

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

Loading…
Cancel
Save