add more consistent extension matching for inventory plugins (#46786)

* Add consistent extension matching for inventory plugins that support YAML configuration files

* Document extension matching expectations
This commit is contained in:
Sloane Hertel 2018-10-11 12:06:52 -04:00 committed by Alicia Cozine
parent e3882ad6f6
commit f3d5ebb355
9 changed files with 21 additions and 22 deletions

View file

@ -100,7 +100,7 @@ class InventoryModule(BaseInventoryPlugin, Cacheable):
valid = False
if super(InventoryModule, self).verify_file(path):
if path.endswith('.foreman.yaml') or path.endswith('.foreman.yml'):
if path.endswith(('foreman.yaml', 'foreman.yml')):
valid = True
return valid