aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/settings.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-08-20 15:35:16 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-08-20 15:35:16 +0100
commit860137188b96208fad7e3931fd632998aa33979d (patch)
tree36a0a391c48c290263bf8de3971b9796df2de289 /src/plugins/lua/settings.lua
parent78b4c55e9ef58c9ca136607946ab5913151db7eb (diff)
downloadrspamd-860137188b96208fad7e3931fd632998aa33979d.tar.gz
rspamd-860137188b96208fad7e3931fd632998aa33979d.zip
Fix reading maps.
Diffstat (limited to 'src/plugins/lua/settings.lua')
-rw-r--r--src/plugins/lua/settings.lua14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/plugins/lua/settings.lua b/src/plugins/lua/settings.lua
index 48a9ceb11..84825dbbd 100644
--- a/src/plugins/lua/settings.lua
+++ b/src/plugins/lua/settings.lua
@@ -315,12 +315,18 @@ end
-- Parse settings map from the ucl line
local function process_settings_map(string)
- local ucl_parser = require "ucl.parser"
- local res,err = ucl_parser:parse_string(string)
+ local ucl = require "ucl"
+ local parser = ucl.parser(1)
+ local res,err = parser:parse_string(string)
if not res then
- rspamd_log.warn('cannot parse settings map: ' .. err)
+ rspamd_logger.warn('cannot parse settings map: ' .. err)
else
- process_settings_table(res)
+ local obj = parser:get_object()
+ if obj['settings'] then
+ process_settings_table(obj['settings'])
+ else
+ process_settings_table(obj)
+ end
end
end