diff options
author | Ted Trask <ttrask01@yahoo.com> | 2013-10-17 19:07:53 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2013-10-17 19:07:53 +0000 |
commit | 2ece009273252437281c8cc0b84ba2ec49e5d07c (patch) | |
tree | 1c082ee4891a4717f2fea09f0df4a8946d9fdb41 /syslog-model.lua | |
parent | 0537a242f9709271454252e7897a7709144a3b02 (diff) | |
download | acf-alpine-baselayout-2ece009273252437281c8cc0b84ba2ec49e5d07c.tar.bz2 acf-alpine-baselayout-2ece009273252437281c8cc0b84ba2ec49e5d07c.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 'syslog-model.lua')
-rw-r--r-- | syslog-model.lua | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/syslog-model.lua b/syslog-model.lua index 08dacfc..8e3c665 100644 --- a/syslog-model.lua +++ b/syslog-model.lua @@ -1,4 +1,4 @@ -module(..., package.seeall) +local mymodule = {} modelfunctions = require("modelfunctions") fs = require("acf.fs") @@ -145,21 +145,21 @@ 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, "Syslog Status") end -function getlogging() +function mymodule.getlogging() local status = {} - local opts = getconfig() + local opts = mymodule.getconfig() if (opts.value.remotelogging.value == "") or (opts.value.localandnetworklog.value) then status.logfile = cfe({ label="Locally logging to", @@ -176,11 +176,11 @@ function getlogging() return cfe({ type="group", value=status }) end -function get_filedetails() +function mymodule.get_filedetails() return modelfunctions.getfiledetails(configfile) end -function getconfig() +function mymodule.getconfig() local config = {} if (fs.is_file(configfile)) then local configcontent = format.opts_to_table(string.sub((format.parse_ini_file(fs.read_file(configfile) or "", "", "SYSLOGD_OPTS") or ""),2,-2)) @@ -193,7 +193,7 @@ function getconfig() return config end -function updateconfig (self, config) +function mymodule.updateconfig (self, config) local success = true success, config = validateconfig(config) @@ -206,6 +206,8 @@ function updateconfig (self, config) return config end -function update_filedetails (self, filedetails) +function mymodule.update_filedetails (self, filedetails) return modelfunctions.setfiledetails(self, filedetails, {configfile}, validate_configfile) end + +return mymodule |