]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix config transformation with no groups
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 25 Nov 2017 12:24:13 +0000 (12:24 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 25 Nov 2017 12:24:13 +0000 (12:24 +0000)
lualib/rspamd_config_transform.lua
src/rspamadm/configdump.c

index 4f656ca9c1c20928fbef558a15c621b9b0eb6da0..af3e8180e8f43f1537aad2178728e91c699cfaa2 100644 (file)
@@ -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
index 6f320dea141fffb138751d80fecde76385f50436..60cd75c3679376cf5e14271b8cfac07fb640898e 100644 (file)
@@ -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);
 }