From f40e1bc289518decb9be20607248ee6c1d108d06 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Tue, 21 Feb 2017 16:23:22 -0600 Subject: [PATCH] Use proper YAML constructor class for safe loading (cherry picked from commit 9f0b3540237d59b7fa1eed514f86e9f0095a3585) --- lib/ansible/parsing/yaml/constructor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/parsing/yaml/constructor.py b/lib/ansible/parsing/yaml/constructor.py index 6c984ad0802..f85d964c9ca 100644 --- a/lib/ansible/parsing/yaml/constructor.py +++ b/lib/ansible/parsing/yaml/constructor.py @@ -19,7 +19,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from yaml.constructor import Constructor, ConstructorError +from yaml.constructor import SafeConstructor, ConstructorError from yaml.nodes import MappingNode from ansible.parsing.yaml.objects import AnsibleMapping, AnsibleSequence, AnsibleUnicode from ansible.vars.unsafe_proxy import wrap_var @@ -31,7 +31,7 @@ except ImportError: display = Display() -class AnsibleConstructor(Constructor): +class AnsibleConstructor(SafeConstructor): def __init__(self, file_name=None): self._ansible_file_name = file_name super(AnsibleConstructor, self).__init__()