helpers.py: Fixes #27334 include empty task file within a 'block' dis… (#27811)

* helpers.py: Fixes #27334 include empty task file within a 'block' disables the complete block

* include module: added warning if file without tasks is included
This commit is contained in:
giovannisciortino 2017-08-08 15:48:39 +02:00 committed by Brian Coca
parent e244deedbd
commit 1fb1793c70

View file

@ -207,7 +207,8 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
try: try:
data = loader.load_from_file(include_file) data = loader.load_from_file(include_file)
if data is None: if data is None:
return [] display.warning('file %s is empty and had no tasks to include' % include_file)
continue
elif not isinstance(data, list): elif not isinstance(data, list):
raise AnsibleParserError("included task files must contain a list of tasks", obj=data) raise AnsibleParserError("included task files must contain a list of tasks", obj=data)