From 8478e8264732d9abd91435c13fa03d6457cf720d Mon Sep 17 00:00:00 2001 From: James Tanner Date: Fri, 18 Oct 2013 11:19:16 -0400 Subject: [PATCH] Fixes #4583 enforce that vars_files is a list --- lib/ansible/playbook/play.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index b684fb7f283..04d84002dba 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -74,6 +74,8 @@ class Play(object): # We first load the vars files from the datastructure # so we have the default variables to pass into the roles self.vars_files = ds.get('vars_files', []) + if not isinstance(self.vars_files, list): + raise errors.AnsibleError('vars_files must be a list') self._update_vars_files_for_host(None) # now we load the roles into the datastructure @@ -83,6 +85,8 @@ class Play(object): # and finally re-process the vars files as they may have # been updated by the included roles self.vars_files = ds.get('vars_files', []) + if not isinstance(self.vars_files, list): + raise errors.AnsibleError('vars_files must be a list') self._update_vars_files_for_host(None) # template everything to be efficient, but do not pre-mature template