Skip to content

Commit

Permalink
import_tasks: Raise an error when applying notify
Browse files Browse the repository at this point in the history
notify is not valid import_tasks attribute. Raise an error
when user specifies it.

Fixes: ansible#64935

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
  • Loading branch information
Akasurde committed Nov 20, 2019
1 parent 35cc26f commit 199a2fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/64935_import_tasks.yml
@@ -0,0 +1,2 @@
bugfixes:
- Raise an error when including notify in import tasks (https://github.com/ansible/ansible/issues/64935).
2 changes: 1 addition & 1 deletion lib/ansible/playbook/task_include.py
Expand Up @@ -85,7 +85,7 @@ def preprocess_data(self, ds):
diff = set(ds.keys()).difference(self.VALID_INCLUDE_KEYWORDS)
for k in diff:
# This check doesn't handle ``include`` as we have no idea at this point if it is static or not
if ds[k] is not Sentinel and ds['action'] in ('include_tasks', 'include_role'):
if ds[k] is not Sentinel and ds['action'] in ('include_tasks', 'include_role', 'import_tasks'):
if C.INVALID_TASK_ATTRIBUTE_FAILED:
raise AnsibleParserError("'%s' is not a valid attribute for a %s" % (k, self.__class__.__name__), obj=ds)
else:
Expand Down

0 comments on commit 199a2fa

Please sign in to comment.