summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2018-05-19 13:07:37 +0200
committerJo-Philipp Wich <jo@mein.io>2018-05-19 13:07:37 +0200
commit9ed48ef2a62df5406c589ef9a43da51df8d9645c (patch)
treebbb649e12e54146e13274d59c7d1e4448e54f2ac /modules/luci-base
parent72fe5dd70335a6bbbe5db8ecc1885a68d368eb3a (diff)
luci-base: break circular luci.config <> luci.model.uci dependency
On certain environments, mainly with the embedded uhttpd interpreter, the luci.config class cannot be loaded due to a circular dependency with the luci.model.uci class. Break up the dependency by deferring the loading of luci.config in luci.model.uci until it is actually needed. Fixes #1803, FS#1553. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base')
-rw-r--r--modules/luci-base/luasrc/model/uci.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/luci-base/luasrc/model/uci.lua b/modules/luci-base/luasrc/model/uci.lua
index 34323f08bd..461ba9d5a3 100644
--- a/modules/luci-base/luasrc/model/uci.lua
+++ b/modules/luci-base/luasrc/model/uci.lua
@@ -3,7 +3,6 @@
local os = require "os"
local util = require "luci.util"
-local conf = require "luci.config"
local table = require "table"
@@ -148,7 +147,8 @@ function apply(self, rollback)
local _, err
if rollback then
- local timeout = tonumber(conf.apply and conf.apply.rollback or "") or 0
+ local conf = require "luci.config"
+ local timeout = tonumber(conf and conf.apply and conf.apply.rollback or "") or 0
_, err = call("apply", {
timeout = (timeout > 30) and timeout or 30,