Introduce a get_state() function which can be used to access legacy
uci state variables. This is usually not needed anymore but some
packages (mainly mwan3) still rely on this.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-function get(self, config, section, option)
+local function _get(self, operation, config, section, option)
if section == nil then
return nil
elseif type(option) == "string" and option:byte(1) ~= 46 then
if section == nil then
return nil
elseif type(option) == "string" and option:byte(1) ~= 46 then
- local rv, err = util.ubus("uci", "get", {
+ local rv, err = util.ubus("uci", operation, {
config = config,
section = section,
option = option
config = config,
section = section,
option = option
+function get(self, ...)
+ return _get(self, "get", ...)
+end
+
+function get_state(self, ...)
+ return _get(self, "state", ...)
+end
+
function get_all(self, config, section)
local rv, err = util.ubus("uci", "get", {
config = config,
function get_all(self, config, section)
local rv, err = util.ubus("uci", "get", {
config = config,