gluon-core: gluon.util: pass UCI cursor as argument to iterate_radios() instead of using local context
This commit is contained in:
parent
901b122d83
commit
f48d10bdde
@ -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')
|
||||||
|
@ -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
|
||||||
|
@ -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',
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user