summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-11-01 13:42:30 +0100
committerJo-Philipp Wich <jo@mein.io>2019-11-02 20:14:25 +0100
commit1b835a50aabfbfe7d8d16a6d15c853315dc7ba79 (patch)
tree10c01867965d6dccaf7e4cf320e171dc56f0549f
parent8234d03340c03a25ade9eb595f0d2ace0751d08b (diff)
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 <jo@mein.io>
-rw-r--r--modules/luci-base/luasrc/sys.lua3
1 files changed, 2 insertions, 1 deletions
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)