commit 45b2413: [Minor] lua_scanner - use override_defaults

Carsten Rosenberg c.rosenberg at heinlein-support.de
Thu Jan 17 15:07:09 UTC 2019


Author: Carsten Rosenberg
Date: 2019-01-13 01:13:03 +0100
URL: https://github.com/rspamd/rspamd/commit/45b24132aaeb8320819297c77a27fee13f476103

[Minor] lua_scanner - use override_defaults

---
 lualib/lua_scanners/clamav.lua | 4 +---
 lualib/lua_scanners/fprot.lua  | 4 +---
 lualib/lua_scanners/savapi.lua | 4 +---
 lualib/lua_scanners/sophos.lua | 4 +---
 4 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/lualib/lua_scanners/clamav.lua b/lualib/lua_scanners/clamav.lua
index 8e2ae77f5..2e7ecb25c 100644
--- a/lualib/lua_scanners/clamav.lua
+++ b/lualib/lua_scanners/clamav.lua
@@ -45,9 +45,7 @@ local function clamav_config(opts)
     message = default_message,
   }
 
-  for k,v in pairs(opts) do
-    clamav_conf[k] = v
-  end
+  clamav_conf = lua_util.override_defaults(clamav_conf, opts)
 
   if not clamav_conf.prefix then
     clamav_conf.prefix = 'rs_' .. clamav_conf.name .. '_'
diff --git a/lualib/lua_scanners/fprot.lua b/lualib/lua_scanners/fprot.lua
index 9b6ebf802..b56187c8c 100644
--- a/lualib/lua_scanners/fprot.lua
+++ b/lualib/lua_scanners/fprot.lua
@@ -44,9 +44,7 @@ local function fprot_config(opts)
     message = default_message,
   }
 
-  for k,v in pairs(opts) do
-    fprot_conf[k] = v
-  end
+  fprot_conf = lua_util.override_defaults(fprot_conf, opts)
 
   if not fprot_conf.prefix then
     fprot_conf.prefix = 'rs_' .. fprot_conf.name .. '_'
diff --git a/lualib/lua_scanners/savapi.lua b/lualib/lua_scanners/savapi.lua
index dfe67d28c..481f2daab 100644
--- a/lualib/lua_scanners/savapi.lua
+++ b/lualib/lua_scanners/savapi.lua
@@ -47,9 +47,7 @@ local function savapi_config(opts)
     tmpdir = '/tmp',
   }
 
-  for k,v in pairs(opts) do
-    savapi_conf[k] = v
-  end
+  savapi_conf = lua_util.override_defaults(savapi_conf, opts)
 
   if not savapi_conf.prefix then
     savapi_conf.prefix = 'rs_' .. savapi_conf.name .. '_'
diff --git a/lualib/lua_scanners/sophos.lua b/lualib/lua_scanners/sophos.lua
index 712f016be..0f874e756 100644
--- a/lualib/lua_scanners/sophos.lua
+++ b/lualib/lua_scanners/sophos.lua
@@ -46,9 +46,7 @@ local function sophos_config(opts)
     savdi_report_oversize = false,
   }
 
-  for k,v in pairs(opts) do
-    sophos_conf[k] = v
-  end
+  sophos_conf = lua_util.override_defaults(sophos_conf, opts)
 
   if not sophos_conf.prefix then
     sophos_conf.prefix = 'rs_' .. sophos_conf.name .. '_'


More information about the Commits mailing list