scripts: check_site_lib: need_table() now merges all keys before calling subcheck(...)
This also introduces an api change to the subcheck()! Before: -> subcheck(key, value, conf_name) After: -> subcheck(key, conf_name) The idea is, that it's hard to submit a value, which should be then checked again. It's wouldn't be clear (after merging) from which config the value is, and so an helpful error message would be impossible.
This commit is contained in:
		
							parent
							
								
									387bf99ab3
								
							
						
					
					
						commit
						b3c9ac8bce
					
				@ -1,6 +1,6 @@
 | 
			
		||||
need_string(in_site('autoupdater.branch'))
 | 
			
		||||
 | 
			
		||||
local function check_branch(k, _, conf_name)
 | 
			
		||||
local function check_branch(k, conf_name)
 | 
			
		||||
   assert_uci_name(k, conf_name)
 | 
			
		||||
 | 
			
		||||
   local prefix = string.format('autoupdater.branches[%q].', k)
 | 
			
		||||
 | 
			
		||||
@ -5,7 +5,7 @@ need_string_match(in_site('site_seed'), '^' .. ('%x'):rep(64) .. '$')
 | 
			
		||||
if need_table('opkg', nil, false) then
 | 
			
		||||
	need_string('opkg.lede', false)
 | 
			
		||||
 | 
			
		||||
	function check_repo(k, _, conf_name)
 | 
			
		||||
	function check_repo(k, conf_name)
 | 
			
		||||
		-- this is not actually a uci name, but using the same naming rules here is fine
 | 
			
		||||
		assert_uci_name(k, conf_name)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -5,7 +5,7 @@ need_boolean(in_site('mesh_vpn.fastd.configurable'), false)
 | 
			
		||||
need_one_of(in_site('mesh_vpn.fastd.syslog_level'), {'error', 'warn', 'info', 'verbose', 'debug', 'debug2'}, false)
 | 
			
		||||
 | 
			
		||||
local function check_peer(prefix)
 | 
			
		||||
	return function(k, _, conf_name)
 | 
			
		||||
	return function(k, conf_name)
 | 
			
		||||
		assert_uci_name(k, conf_name)
 | 
			
		||||
 | 
			
		||||
		local table = string.format('%s[%q].', prefix, k)
 | 
			
		||||
@ -16,7 +16,7 @@ local function check_peer(prefix)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local function check_group(prefix)
 | 
			
		||||
	return function(k, _, conf_name)
 | 
			
		||||
	return function(k, conf_name)
 | 
			
		||||
		assert_uci_name(k, conf_name)
 | 
			
		||||
 | 
			
		||||
		local table = string.format('%s[%q].', prefix, k)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user