avoid fatal tb on bad fqcn callback name (#69440) (#69496)

(cherry picked from commit 0aa76503dc)
pull/69409/head
Brian Coca 6 years ago committed by GitHub
parent 156b302b4b
commit 4f39d9ac65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- avoid fatal traceback when a bad FQCN for a callback is supplied in the whitelist (#69401).

@ -161,8 +161,11 @@ class TaskQueueManager:
for callback_plugin_name in (c for c in C.DEFAULT_CALLBACK_WHITELIST if AnsibleCollectionRef.is_valid_fqcr(c)):
# TODO: need to extend/duplicate the stdout callback check here (and possible move this ahead of the old way
callback_obj = callback_loader.get(callback_plugin_name)
callback_obj.set_options()
self._callback_plugins.append(callback_obj)
if callback_obj:
callback_obj.set_options()
self._callback_plugins.append(callback_obj)
else:
display.warning("Skipping '%s', unable to load or use as a callback" % callback_plugin_name)
self._callbacks_loaded = True

@ -42,3 +42,6 @@ ansible-playbook -i "${INVENTORY_PATH}" -i ./a.statichost.yml -v "${TEST_PLAYBO
# test adjacent with --playbook-dir
export ANSIBLE_COLLECTIONS_PATHS=''
ANSIBLE_INVENTORY_ANY_UNPARSED_IS_FAILED=1 ansible-inventory -i a.statichost.yml --list --export --playbook-dir=. -v "$@"
# ensure non existing callback does not crash ansible
ANSIBLE_CALLBACK_WHITELIST=charlie.gomez.notme ansible -m ping localhost

Loading…
Cancel
Save