summaryrefslogtreecommitdiffstats
path: root/dnsmasq-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2013-10-18 22:29:04 +0000
committerTed Trask <ttrask01@yahoo.com>2013-10-18 22:29:04 +0000
commit6e6c8803a11dc23f2dfc5cced35b54981395fa9c (patch)
tree182cba17869721d350138ed5d7f5cd12a00b8046 /dnsmasq-model.lua
parent3cdbb88e20095542f951d580581df5b53960240d (diff)
downloadacf-dnsmasq-6e6c8803a11dc23f2dfc5cced35b54981395fa9c.tar.bz2
acf-dnsmasq-6e6c8803a11dc23f2dfc5cced35b54981395fa9c.tar.xz
Remove all calls to 'module' in preparation for move to Lua 5.2
Use mymodule parameter for module definition. This was also helpful in revealing places where the code relied on the global environment.
Diffstat (limited to 'dnsmasq-model.lua')
-rw-r--r--dnsmasq-model.lua20
1 files changed, 11 insertions, 9 deletions
diff --git a/dnsmasq-model.lua b/dnsmasq-model.lua
index 181f2cd..c6e4ddd 100644
--- a/dnsmasq-model.lua
+++ b/dnsmasq-model.lua
@@ -1,4 +1,4 @@
-module(..., package.seeall)
+local mymodule = {}
-- Load libraries
modelfunctions = require("modelfunctions")
@@ -267,19 +267,19 @@ end
-- ################################################################################
-- PUBLIC FUNCTIONS
-function get_startstop(self, clientdata)
+function mymodule.get_startstop(self, clientdata)
return modelfunctions.get_startstop(processname)
end
-function startstop_service(self, startstop, action)
+function mymodule.startstop_service(self, startstop, action)
return modelfunctions.startstop_service(startstop, action)
end
-function getstatus()
+function mymodule.getstatus()
return modelfunctions.getstatus(processname, packagename, "DNS Masq Status")
end
-function getconfig()
+function mymodule.getconfig()
local conf = parse_file(fs.read_file(configfile) or "") or {}
local dns_filtering = {}
dns_filtering.enabled = dns_filtering_is_enabled(conf)
@@ -303,7 +303,7 @@ function getconfig()
return cfe({ type="group", value=output, label="DNS Masq Config" })
end
-function setconfig(self, config)
+function mymodule.setconfig(self, config)
local success, config = validateconfig(self, config)
if success then
@@ -330,16 +330,18 @@ function setconfig(self, config)
return config
end
-function getconfigfile()
+function mymodule.getconfigfile()
-- FIXME Validate
return modelfunctions.getfiledetails(configfile)
end
-function setconfigfile(self, filedetails)
+function mymodule.setconfigfile(self, filedetails)
-- FIXME Validate
return modelfunctions.setfiledetails(self, filedetails, {configfile})
end
-function getleases()
+function mymodule.getleases()
return modelfunctions.getfiledetails(leasefile)
end
+
+return mymodule