From d5fb11d89c4094ef0eab0c19a431575a0af4d068 Mon Sep 17 00:00:00 2001 From: Serge van Ginderachter Date: Tue, 14 Jul 2015 00:20:04 +0200 Subject: [PATCH] Use YAML_FILENAME_EXTENSIONS for vars files. The v2 codebase didn't use this previously introduced constant yet. C.YAML_FILENAME_EXTENSIONS --- lib/ansible/vars/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/vars/__init__.py b/lib/ansible/vars/__init__.py index 13c9cc8f08b..3f9fb8fc5cb 100644 --- a/lib/ansible/vars/__init__.py +++ b/lib/ansible/vars/__init__.py @@ -314,11 +314,11 @@ class VariableManager: file_name, ext = os.path.splitext(path) data = None if not ext: - for ext in ('', '.yml', '.yaml'): + for ext in C.YAML_FILENAME_EXTENSIONS: new_path = path + ext if loader.path_exists(new_path): - data = loader.load_from_file(new_path) - break + data = loader.load_from_file(new_path) + break else: if loader.path_exists(path): data = loader.load_from_file(path)