diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2008-08-24 16:09:02 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2008-08-24 16:09:02 +0000 |
commit | 1946740198db90e203aa0d9cc481f5ff787b8257 (patch) | |
tree | 4b8928b11447f5fd417c68a4d8c6a29f560c2a03 /libs/uvl | |
parent | 23101e71374383bdd1bae09166c2581daaa44b22 (diff) |
* luci/libs: uvl: implement "named" flag for schemes
Diffstat (limited to 'libs/uvl')
-rw-r--r-- | libs/uvl/luasrc/uvl.lua | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libs/uvl/luasrc/uvl.lua b/libs/uvl/luasrc/uvl.lua index a9359d0c3..bc22c81f8 100644 --- a/libs/uvl/luasrc/uvl.lua +++ b/libs/uvl/luasrc/uvl.lua @@ -298,6 +298,13 @@ end function UVL._validate_section( self, section ) if section:values() then + if section:section().named == true and + section:values()['.anonymous'] == true + then + return false, self.log.section_error( section, + 'The section of type "' .. section:sid() .. '" is stored ' .. + 'anonymously in config but must be named' ) + end for _, v in ipairs(section:variables()) do local ok, err = self:_validate_option( v ) @@ -500,7 +507,9 @@ function UVL._read_scheme_parts( self, scheme, schemes ) 'dependency specification in "%s"', v.name or '<nil>', scheme or '<nil>', k ) - elseif k == "dynamic" or k == "unique" or k == "required" then + elseif k == "dynamic" or k == "unique" or + k == "required" or k == "named" + then s[k] = _bool(v2) else s[k] = v2 @@ -511,6 +520,7 @@ function UVL._read_scheme_parts( self, scheme, schemes ) s.dynamic = s.dynamic or false s.unique = s.unique or false s.required = s.required or false + s.named = s.named or false end end end |