diff options
author | Kevin Bell <kevin.a.bell@gmail.com> | 2014-05-14 23:32:53 -0700 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2014-05-21 14:59:29 -0500 |
commit | 2432b45eb1e081bbc58ba1c04e6b75f58e92b31d (patch) | |
tree | 73ca01002451d3b5bb7f74b5663e2c4ca7c646c9 | |
parent | d6214c5d56cf070f682dae224ed4a51af532fbbd (diff) | |
download | ansible-2432b45eb1e081bbc58ba1c04e6b75f58e92b31d.tar.gz |
Fixed extension filtering in InventoryDirectory
-rw-r--r-- | lib/ansible/inventory/dir.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/ansible/inventory/dir.py b/lib/ansible/inventory/dir.py index 53a6349fc7..e3eda22695 100644 --- a/lib/ansible/inventory/dir.py +++ b/lib/ansible/inventory/dir.py @@ -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 |