From 68329eaa235759a418faefb179b4ebaa22d05040 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 11 Apr 2018 14:08:23 +0100 Subject: [PATCH] [Minor] Check actions section sanity --- lualib/lua_cfg_transform.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lualib/lua_cfg_transform.lua b/lualib/lua_cfg_transform.lua index 971b60171..af5bf5999 100644 --- a/lualib/lua_cfg_transform.lua +++ b/lualib/lua_cfg_transform.lua @@ -257,6 +257,22 @@ return function(cfg) end end end + + local actions_set = {} + for _,d in ipairs(actions_defs) do + actions_set[d] = true + end + + -- Now check actions section for garbadge + actions_set['unknown_weight'] = true + actions_set['grow_factor'] = true + actions_set['subject'] = true + + for k,v in pairs(cfg.actions) do + if not actions_set[k] then + logger.warnx('unknown element in actions section: %s', k) + end + end end if not cfg.group then -- 2.39.5