From 4e0013d161f61d7a606a7e33c97b10d9283a9390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Moser?= Date: Mon, 25 Apr 2016 19:40:49 +0200 Subject: [PATCH] playbook, include: fix Unexpected Exception: 'NoneType' object has no attribute 'strip' (#15574) If `include:` statement is used without argument, we get a traceback. --- lib/ansible/playbook/playbook_include.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/playbook/playbook_include.py b/lib/ansible/playbook/playbook_include.py index 2ce076edb11..f481ba142c8 100644 --- a/lib/ansible/playbook/playbook_include.py +++ b/lib/ansible/playbook/playbook_include.py @@ -135,6 +135,9 @@ class PlaybookInclude(Base, Conditional, Taggable): 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 # to include. Anything after that should be regarded as a parameter to the include items = split_args(v)