Skip to content
Snippets Groups Projects
Commit bead07dc authored by Philippe's avatar Philippe
Browse files

replace normal uses of luci.model.uci with simple-uci

parent 64ef1b3c
No related branches found
No related tags found
No related merge requests found
local cbi = require "luci.cbi" local cbi = require "luci.cbi"
local i18n = require "luci.i18n" local i18n = require "luci.i18n"
local uci = luci.model.uci.cursor() local uci = require("simple-uci").cursor()
local M = {} local M = {}
...@@ -19,11 +19,7 @@ end ...@@ -19,11 +19,7 @@ end
function M.handle(data) function M.handle(data)
local sname = uci:get_first("gluon-node-info", "location") local sname = uci:get_first("gluon-node-info", "location")
if data._zip ~= nil then
uci:set("gluon-node-info", sname, "zip", data._zip:trim()) uci:set("gluon-node-info", sname, "zip", data._zip:trim())
else
uci:delete("gluon-node-info", sname, "zip")
end
uci:save("gluon-node-info") uci:save("gluon-node-info")
uci:commit("gluon-node-info") uci:commit("gluon-node-info")
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment