summaryrefslogtreecommitdiff
path: root/lib/ansible/playbook
diff options
context:
space:
mode:
authorBrad Olson <brado@movedbylight.com>2012-05-29 10:23:09 -0400
committerBrad Olson <brado@movedbylight.com>2012-05-29 10:23:09 -0400
commit69270970518e8c7a36f0d34f2bf7d967ecf402c0 (patch)
tree079f8eacbd42b61ee78e7da7eb5296583ecc9c00 /lib/ansible/playbook
parent87c0555602d978638cdc6b47ef8fc00648f7ab4e (diff)
downloadansible-69270970518e8c7a36f0d34f2bf7d967ecf402c0.tar.gz
Avoid traceback when vars file has no vars items. Could warn or fail instead.
Diffstat (limited to 'lib/ansible/playbook')
-rw-r--r--lib/ansible/playbook/play.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py
index 400ca7bf65..f884dda9c5 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.