luci-app-mwan3: bugfix 1744/head
authorDirk Brenken <dev@brenken.org>
Tue, 10 Apr 2018 19:38:07 +0000 (21:38 +0200)
committerDirk Brenken <dev@brenken.org>
Tue, 10 Apr 2018 19:38:07 +0000 (21:38 +0200)
* two more luci.model.uci fixes for #1743

Signed-off-by: Dirk Brenken <dev@brenken.org>
applications/luci-app-mwan3/luasrc/controller/mwan3.lua

index d8fba79c79ae15c5d4c08425b5296669c08a436f..d5fc4a3edefcdd0f9fbafddce64840b266815ecd 100644 (file)
@@ -85,7 +85,8 @@ function diagnosticsData(interface, task)
        function getInterfaceNumber(interface)
                local number = 0
                local interfaceNumber
-               uci.cursor():foreach("mwan3", "interface",
+               local uci = require "luci.model.uci".cursor()
+               uci:foreach("mwan3", "interface",
                        function (section)
                                number = number+1
                                if section[".name"] == interface then
@@ -130,7 +131,7 @@ function diagnosticsData(interface, task)
        local results = ""
        local number = getInterfaceNumber(interface)
 
-       local uci = uci.cursor(nil, "/var/state")
+       local uci = require "luci.model.uci".cursor(nil, "/var/state")
        local device = uci:get("network", interface, "ifname")
 
        luci.http.prepare_content("text/plain")