gluon-core: gluon.util: pass UCI cursor as argument to iterate_radios() instead of using local context

This commit is contained in:
Matthias Schiffer 2017-04-11 01:35:49 +02:00
parent 901b122d83
commit f48d10bdde
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C
4 changed files with 4 additions and 4 deletions

View File

@ -51,6 +51,6 @@ local function configure_radio(radio, index, config)
configure_client(config.ap, radio, index, suffix) configure_client(config.ap, radio, index, suffix)
end end
util.iterate_radios(configure_radio) util.iterate_radios(uci, configure_radio)
uci:save('wireless') uci:save('wireless')

View File

@ -199,7 +199,7 @@ local function configure_radio(radio, index, config)
fixup_wan(radio, index) fixup_wan(radio, index)
end end
util.iterate_radios(configure_radio) util.iterate_radios(uci, configure_radio)
if uci:get('system', 'rssid_wlan0') then if uci:get('system', 'rssid_wlan0') then

View File

@ -235,7 +235,7 @@ end
-- Iterate over all radios defined in UCI calling -- Iterate over all radios defined in UCI calling
-- f(radio, index, site.wifiX) for each radio found while passing -- f(radio, index, site.wifiX) for each radio found while passing
-- site.wifi24 for 2.4 GHz devices and site.wifi5 for 5 GHz ones. -- site.wifi24 for 2.4 GHz devices and site.wifi5 for 5 GHz ones.
function iterate_radios(f) function iterate_radios(uci, f)
local radios = {} local radios = {}
uci:foreach('wireless', 'wifi-device', uci:foreach('wireless', 'wifi-device',

View File

@ -27,7 +27,7 @@ key.datatype = "wpakey"
key.default = uci:get('wireless', primary_iface, "key") key.default = uci:get('wireless', primary_iface, "key")
function f:write() function f:write()
util.iterate_radios(function(radio, index) util.iterate_radios(uci, function(radio, index)
local name = "wan_" .. radio local name = "wan_" .. radio
if enabled.data then if enabled.data then