* luci/libs: uvl: invalid wrong "option not found in config" errors
This commit is contained in:
parent
8003e3b648
commit
5778eae369
2 changed files with 9 additions and 2 deletions
|
@ -70,6 +70,7 @@ function UVL.__init__( self, schemedir )
|
||||||
self.schemedir = schemedir or default_schemedir
|
self.schemedir = schemedir or default_schemedir
|
||||||
self.packages = { }
|
self.packages = { }
|
||||||
self.beenthere = { }
|
self.beenthere = { }
|
||||||
|
self.depseen = { }
|
||||||
self.uci = luci.model.uci
|
self.uci = luci.model.uci
|
||||||
self.err = luci.uvl.errors
|
self.err = luci.uvl.errors
|
||||||
self.dep = luci.uvl.dependencies
|
self.dep = luci.uvl.dependencies
|
||||||
|
@ -124,6 +125,7 @@ function UVL.validate_config( self, config, uci )
|
||||||
local sc = { }
|
local sc = { }
|
||||||
|
|
||||||
self.beenthere = { }
|
self.beenthere = { }
|
||||||
|
self.depseen = { }
|
||||||
|
|
||||||
if not co:config() then
|
if not co:config() then
|
||||||
return false, co:errors()
|
return false, co:errors()
|
||||||
|
@ -187,6 +189,7 @@ function UVL.validate_section( self, config, section, uci )
|
||||||
local so = co:section( section )
|
local so = co:section( section )
|
||||||
|
|
||||||
self.beenthere = { }
|
self.beenthere = { }
|
||||||
|
self.depseen = { }
|
||||||
|
|
||||||
if not co:config() then
|
if not co:config() then
|
||||||
return false, co:errors()
|
return false, co:errors()
|
||||||
|
@ -232,6 +235,8 @@ end
|
||||||
|
|
||||||
function UVL._validate_section( self, section )
|
function UVL._validate_section( self, section )
|
||||||
|
|
||||||
|
self.beenthere[section:cid()] = true
|
||||||
|
|
||||||
if section:config() then
|
if section:config() then
|
||||||
if section:scheme('named') == true and
|
if section:scheme('named') == true and
|
||||||
section:config('.anonymous') == true
|
section:config('.anonymous') == true
|
||||||
|
@ -268,6 +273,8 @@ end
|
||||||
|
|
||||||
function UVL._validate_option( self, option, nodeps )
|
function UVL._validate_option( self, option, nodeps )
|
||||||
|
|
||||||
|
self.beenthere[option:cid()] = true
|
||||||
|
|
||||||
if not option:scheme() and not option:parent():scheme('dynamic') then
|
if not option:scheme() and not option:parent():scheme('dynamic') then
|
||||||
return false, option:error(ERR.OPT_UNKNOWN(option))
|
return false, option:error(ERR.OPT_UNKNOWN(option))
|
||||||
|
|
||||||
|
|
|
@ -72,8 +72,8 @@ function check( self, object, nodeps )
|
||||||
|
|
||||||
local derr = ERR.DEPENDENCY(object)
|
local derr = ERR.DEPENDENCY(object)
|
||||||
|
|
||||||
if not self.beenthere[object:cid()] then
|
if not self.depseen[object:cid()] then
|
||||||
self.beenthere[object:cid()] = true
|
self.depseen[object:cid()] = true
|
||||||
else
|
else
|
||||||
return false, derr:child(ERR.DEP_RECURSIVE(object))
|
return false, derr:child(ERR.DEP_RECURSIVE(object))
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue