Properly handle group/host_var files with dots in them

Fixes #12245
This commit is contained in:
James Cammarata 2015-09-08 03:20:09 -04:00
commit ac6f61ec7f
2 changed files with 16 additions and 4 deletions

View file

@ -317,9 +317,9 @@ class VariableManager:
else:
file_name, ext = os.path.splitext(path)
data = None
if not ext:
for ext in C.YAML_FILENAME_EXTENSIONS:
new_path = path + ext
if not ext or ext not in C.YAML_FILENAME_EXTENSIONS:
for test_ext in C.YAML_FILENAME_EXTENSIONS:
new_path = path + test_ext
if loader.path_exists(new_path):
data = loader.load_from_file(new_path)
break