From 1b835a50aabfbfe7d8d16a6d15c853315dc7ba79 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 1 Nov 2019 13:42:30 +0100 Subject: [PATCH] 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 --- modules/luci-base/luasrc/sys.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/luci-base/luasrc/sys.lua b/modules/luci-base/luasrc/sys.lua index f82cd78cb7..c8ad5393e0 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) -- 2.30.2