From 7ea4a0e89545a122f0dfe02c621dec4c145b70d8 Mon Sep 17 00:00:00 2001 From: Brad Olson Date: Tue, 29 May 2012 10:23:09 -0400 Subject: [PATCH] Avoid traceback when vars file has no vars items. Could warn or fail instead. --- lib/ansible/playbook/play.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index 400ca7bf657..f884dda9c55 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -186,5 +186,7 @@ class Play(object): fpath = utils.path_dwim(self.playbook.basedir, utils.template(filename, self.vars)) new_vars = utils.parse_yaml_from_file(fpath) - self.playbook.SETUP_CACHE[host].update(new_vars) + if new_vars: + self.playbook.SETUP_CACHE[host].update(new_vars) + #else: could warn if vars file contains no vars.