From: Jo-Philipp Wich Date: Fri, 1 Nov 2019 12:42:30 +0000 (+0100) Subject: luci-base: sys.lua: lazy-load luci.model.network X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1b835a50aabfbfe7d8d16a6d15c853315dc7ba79;p=oweals%2Fluci.git luci-base: sys.lua: lazy-load luci.model.network This allows using luci.sys without installed luci.model.network class. Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/luasrc/sys.lua b/modules/luci-base/luasrc/sys.lua index f82cd78cb..c8ad5393e 100644 --- a/modules/luci-base/luasrc/sys.lua +++ b/modules/luci-base/luasrc/sys.lua @@ -7,7 +7,6 @@ local table = require "table" local nixio = require "nixio" local fs = require "nixio.fs" local uci = require "luci.model.uci" -local ntm = require "luci.model.network" local luci = {} luci.util = require "luci.util" @@ -537,6 +536,8 @@ end wifi = {} function wifi.getiwinfo(ifname) + local ntm = require "luci.model.network" + ntm.init() local wnet = ntm:get_wifinet(ifname)