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

pull/69499/head
Brian Coca 5 years ago committed by GitHub
parent eb3e4b3a7b
commit 0aa76503dc
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).

@ -162,8 +162,11 @@ class TaskQueueManager:
for callback_plugin_name in (c for c in C.DEFAULT_CALLBACK_WHITELIST if AnsibleCollectionRef.is_valid_fqcr(c)): 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 # 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 = callback_loader.get(callback_plugin_name)
callback_obj.set_options() if callback_obj:
self._callback_plugins.append(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 self._callbacks_loaded = True

@ -71,3 +71,6 @@ if [[ "$(grep -wc "dynamic_host_a" "$CACHEFILE")" -ne "0" ]]; then
fi fi
./vars_plugin_tests.sh ./vars_plugin_tests.sh
# ensure non existing callback does not crash ansible
ANSIBLE_CALLBACK_WHITELIST=charlie.gomez.notme ansible -m ping localhost

Loading…
Cancel
Save