From 65967cdddf5ff8d858ff070bdc7885482408d2b7 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 25 Nov 2017 12:24:13 +0000 Subject: [PATCH] [Minor] Fix config transformation with no groups --- lualib/rspamd_config_transform.lua | 6 ++++++ src/rspamadm/configdump.c | 7 +------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lualib/rspamd_config_transform.lua b/lualib/rspamd_config_transform.lua index 4f656ca9c..af3e8180e 100644 --- a/lualib/rspamd_config_transform.lua +++ b/lualib/rspamd_config_transform.lua @@ -209,6 +209,12 @@ local function convert_metric(cfg, metric) for k, v in metric_pairs(metric.group) do group_transform(cfg, k, v) end + else + cfg.group = { + ungrouped = { + symbols = {} + } + } end if metric.symbol then diff --git a/src/rspamadm/configdump.c b/src/rspamadm/configdump.c index 6f320dea1..60cd75c36 100644 --- a/src/rspamadm/configdump.c +++ b/src/rspamadm/configdump.c @@ -284,7 +284,6 @@ rspamadm_configdump (gint argc, gchar **argv) } else { /* Do post-load actions */ - rspamd_lua_set_path (cfg->lua_state, cfg->rcl_obj, ucl_vars); rspamd_lua_post_load_config (cfg); if (!rspamd_init_filters (rspamd_main->cfg, FALSE)) { @@ -328,9 +327,5 @@ rspamadm_configdump (gint argc, gchar **argv) } } - if (!ret) { - exit (EXIT_FAILURE); - } - - exit (EXIT_SUCCESS); + exit (ret ? EXIT_SUCCESS : EXIT_FAILURE); } -- 2.39.5