From a9ea3136cf7d66bce499223afc3ceecbd47d2472 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sat, 23 Feb 2013 13:30:10 -0500 Subject: [PATCH] Use yaml.safe_load as we are just using basic data structures --- lib/ansible/utils/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/utils/__init__.py b/lib/ansible/utils/__init__.py index 3564897f5f9..d81a246ff62 100644 --- a/lib/ansible/utils/__init__.py +++ b/lib/ansible/utils/__init__.py @@ -237,7 +237,7 @@ def parse_json(raw_data): def parse_yaml(data): ''' convert a yaml string to a data structure ''' - return yaml.load(data) + return yaml.safe_load(data) def process_yaml_error(exc, data, path=None): if hasattr(exc, 'problem_mark'): @@ -345,7 +345,7 @@ def _gitinfo(): # Check if the .git is a file. If it is a file, it means that we are in a submodule structure. if os.path.isfile(repo_path): try: - gitdir = yaml.load(open(repo_path)).get('gitdir') + gitdir = yaml.safe_load(open(repo_path)).get('gitdir') # There is a posibility the .git file to have an absolute path. if os.path.isabs(gitdir): repo_path = gitdir