From: Vsevolod Stakhov Date: Wed, 15 Nov 2017 20:30:37 +0000 (+0000) Subject: [Minor] Treat groups with no symbols specially X-Git-Tag: 1.7.0~434 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d74b26aeadf0aaf82955ce4a3e5ac1b6077fb909;p=rspamd.git [Minor] Treat groups with no symbols specially --- diff --git a/lualib/rspamd_config_transform.lua b/lualib/rspamd_config_transform.lua index f1eb2a6ac..bca42691a 100644 --- a/lualib/rspamd_config_transform.lua +++ b/lualib/rspamd_config_transform.lua @@ -169,7 +169,15 @@ local function test_groups(groups) local all_symbols = {} for gr_name, gr in pairs(groups) do if not gr.symbols then - logger.errx('group %s has no symbols', gr_name) + local cnt = 0 + for _,_ in pairs(gr) do cnt = cnt + 1 end + + if cnt == 0 then + logger.errx('group %s is empty', gr_name) + else + logger.infox('group %s has no symbols', gr_name) + end + else for sn,_ in pairs(gr.symbols) do if all_symbols[sn] then