From: Tobias Ulmer Date: Mon, 13 Aug 2012 10:16:56 +0000 (+0200) Subject: Inline init_plugin() and exit_plugin() X-Git-Tag: e2factory-2.3.13rc1~172 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=3c6ccc536b27093c0d622787318d0e956fd431c2;p=e2factory.git Inline init_plugin() and exit_plugin() Signed-off-by: Tobias Ulmer --- diff --git a/generic/plugin.lua b/generic/plugin.lua index 4289134..797e1c6 100644 --- a/generic/plugin.lua +++ b/generic/plugin.lua @@ -59,7 +59,7 @@ local err = require("err") -- @return an error object on failure -- list of plugin descriptors -plugins = {} +local plugins = {} --[[ example plugin descriptor: -- plugin = { @@ -110,21 +110,6 @@ local function load_plugin(dir, p, ctx) return true, nil end ---- initialize a plugin --- @param pd table: plugin descriptor --- @return bool --- @return an error object on failure -local function init_plugin(pd) - return pd.init(pd.ctx) -end - ---- deinitialize a plugin --- @param pd table: plugin descriptor --- @return bool -local function exit_plugin(pd) - return pd.exit(pd.ctx) -end - --- load plugins from a directory, and apply the plugin context -- @param dir string: directory -- @param ctx table: plugin context @@ -149,7 +134,7 @@ end function plugin.init_plugins() local e = err.new("initializing plugins failed") for _, pd in ipairs(plugins) do - local rc, re = init_plugin(pd) + local rc, re = pd.init(pd.ctx) if not rc then return false, e:cat(re) end @@ -163,7 +148,7 @@ end function plugin.exit_plugins() local e = err.new("deinitializing plugins failed") for _, pd in ipairs(plugins) do - local rc, re = exit_plugin(pd) + local rc, re = pd.exit(pd.ctx) if not rc then return false, e:cat(re) end