1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fixed extension filtering in InventoryDirectory

This commit is contained in:
Kevin Bell 2014-05-14 23:32:53 -07:00
parent bcfef8d0d4
commit 92bd755b47

View file

@ -40,9 +40,8 @@ class InventoryDirectory(object):
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