Avoid traceback when vars file has no vars items. Could warn or fail instead.

pull/4420/head
Brad Olson 2012-05-29 10:23:09 -04:00
parent c03fec4864
commit 7ea4a0e895
1 changed files with 3 additions and 1 deletions

View File

@ -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.