Use YAML_FILENAME_EXTENSIONS for vars files.

The v2 codebase didn't use this previously introduced constant yet.

C.YAML_FILENAME_EXTENSIONS
parent c4b6d912
...@@ -314,11 +314,11 @@ class VariableManager: ...@@ -314,11 +314,11 @@ class VariableManager:
file_name, ext = os.path.splitext(path) file_name, ext = os.path.splitext(path)
data = None data = None
if not ext: if not ext:
for ext in ('', '.yml', '.yaml'): for ext in C.YAML_FILENAME_EXTENSIONS:
new_path = path + ext new_path = path + ext
if loader.path_exists(new_path): if loader.path_exists(new_path):
data = loader.load_from_file(new_path) data = loader.load_from_file(new_path)
break break
else: else:
if loader.path_exists(path): if loader.path_exists(path):
data = loader.load_from_file(path) data = loader.load_from_file(path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment