1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

playbook, include: fix Unexpected Exception: 'NoneType' object has no attribute 'strip' (#15574)

If `include:` statement is used without argument, we get a traceback.
This commit is contained in:
René Moser 2016-04-25 19:40:49 +02:00 committed by James Cammarata
parent 57574881ae
commit 4e0013d161

View file

@ -135,6 +135,9 @@ class PlaybookInclude(Base, Conditional, Taggable):
Splits the include line up into filename and parameters Splits the include line up into filename and parameters
''' '''
if v is None:
raise AnsibleParserError("include parameter is missing", obj=ds)
# The include line must include at least one item, which is the filename # The include line must include at least one item, which is the filename
# to include. Anything after that should be regarded as a parameter to the include # to include. Anything after that should be regarded as a parameter to the include
items = split_args(v) items = split_args(v)