Make sure yaml data loaded for role is valid before using it

Fixes #4322
pull/4329/head
James Cammarata 11 years ago
parent bff47df5ff
commit 8a3f8b757b

@ -449,7 +449,7 @@ class Play(object):
include_file = template(dirname, tokens[0], mv) include_file = template(dirname, tokens[0], mv)
include_filename = utils.path_dwim(dirname, include_file) include_filename = utils.path_dwim(dirname, include_file)
data = utils.parse_yaml_from_file(include_filename) data = utils.parse_yaml_from_file(include_filename)
if 'role_name' in x: if 'role_name' in x and data is not None:
for x in data: for x in data:
if 'include' in x: if 'include' in x:
x['role_name'] = new_role x['role_name'] = new_role

Loading…
Cancel
Save