From be05cb0e1965d5c7cdd906e64c1287695df72406 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 14 Aug 2019 20:06:21 -0400 Subject: [PATCH] cli: exit with error if a plugin fails to load The CLI is currently permissive when plugins fails to load, it will display an error but carry on. To make it easier for users to catch configuration and programming problems, this patch changes that be strict. If a plugin fails to load (for example, Python syntax error), the CLI stops and the error is reported to the user. If this ever becomes a problem (a user would like to carry on even though some plugin fails to load), we can add a switch like `--ignore-plugin-loading-error` to have a permissive mode. Change-Id: Ic89d4e044ecdc34a6e169309479e17bb947ae637 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/1937 Tested-by: jenkins Reviewed-by: Philippe Proulx --- src/cli/babeltrace2-plugins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/babeltrace2-plugins.c b/src/cli/babeltrace2-plugins.c index 28ee50a5..0093d4ce 100644 --- a/src/cli/babeltrace2-plugins.c +++ b/src/cli/babeltrace2-plugins.c @@ -161,7 +161,7 @@ int load_dynamic_plugins(const bt_value *plugin_paths) } status = bt_plugin_find_all_from_dir(plugin_path, BT_FALSE, - BT_FALSE, &plugin_set); + BT_TRUE, &plugin_set); if (status < 0) { BT_CLI_LOGE_APPEND_CAUSE( "Unable to load dynamic plugins from directory: " -- 2.34.1