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>
This commit is contained in:
Jo-Philipp Wich 2018-05-19 13:07:37 +02:00
parent 72fe5dd703
commit 9ed48ef2a6

View file

@ -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,