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:
parent
bcfef8d0d4
commit
92bd755b47
1 changed files with 3 additions and 4 deletions
|
@ -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…
Reference in a new issue