From 339042c46a187567de3e19b6f383ed72ed007f7d Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 27 Aug 2008 17:51:35 +0000 Subject: * luci/libs: uvl: allow optional uci config as argument in validate_*() --- libs/uvl/luasrc/uvl.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libs/uvl/luasrc/uvl.lua') diff --git a/libs/uvl/luasrc/uvl.lua b/libs/uvl/luasrc/uvl.lua index 560be3070..5cad3d20e 100644 --- a/libs/uvl/luasrc/uvl.lua +++ b/libs/uvl/luasrc/uvl.lua @@ -110,7 +110,7 @@ end -- @param config Name of the configuration to validate -- @return Boolean indicating whether the given config validates -- @return String containing the reason for errors (if any) -function UVL.validate_config( self, config ) +function UVL.validate_config( self, config, uci ) if not self.packages[config] then local ok, err = self:read_scheme(config) @@ -119,7 +119,7 @@ function UVL.validate_config( self, config ) end end - local co = luci.uvl.config( self, config ) + local co = luci.uvl.config( self, uci or config, uci and config ) local sc = { } self.beenthere = { } @@ -173,7 +173,7 @@ end -- @param section Name of the section to validate -- @return Boolean indicating whether the given config validates -- @return String containing the reason for errors (if any) -function UVL.validate_section( self, config, section ) +function UVL.validate_section( self, config, section, uci ) if not self.packages[config] then local ok, err = self:read_scheme( config ) @@ -182,7 +182,7 @@ function UVL.validate_section( self, config, section ) end end - local co = luci.uvl.config( self, config ) + local co = luci.uvl.config( self, uci or config, uci and config ) local so = co:section( section ) self.beenthere = { } @@ -204,7 +204,7 @@ end -- @param option Name of the option to validate -- @return Boolean indicating whether the given config validates -- @return String containing the reason for errors (if any) -function UVL.validate_option( self, config, section, option ) +function UVL.validate_option( self, config, section, option, uci ) if not self.packages[config] then local ok, err = self:read_scheme( config ) @@ -213,7 +213,7 @@ function UVL.validate_option( self, config, section, option ) end end - local co = luci.uvl.config( self, config ) + local co = luci.uvl.config( self, uci or config, uci and config ) local so = co:section( section ) local oo = so:option( option ) -- cgit v1.2.3