summaryrefslogtreecommitdiffstats
path: root/postgresql-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2013-10-25 23:19:16 +0000
committerTed Trask <ttrask01@yahoo.com>2013-10-25 23:19:16 +0000
commit36a4fe6c80eb77f97fc6c2b5f820e6b9d458dc2e (patch)
tree0971226a82fb80c588983c39e73f998ae0a3ae9b /postgresql-model.lua
parent58b3dd5c3a5e4a9d76ec432e0c2ee6bf37d908ad (diff)
downloadacf-postgresql-36a4fe6c80eb77f97fc6c2b5f820e6b9d458dc2e.tar.bz2
acf-postgresql-36a4fe6c80eb77f97fc6c2b5f820e6b9d458dc2e.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 'postgresql-model.lua')
-rw-r--r--postgresql-model.lua20
1 files changed, 11 insertions, 9 deletions
diff --git a/postgresql-model.lua b/postgresql-model.lua
index 1c492f3..efb86d4 100644
--- a/postgresql-model.lua
+++ b/postgresql-model.lua
@@ -1,4 +1,4 @@
-module(..., package.seeall)
+local mymodule = {}
-- Load libraries
modelfunctions = require("modelfunctions")
@@ -15,7 +15,7 @@ local path = "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
local datadirectory
local filelist
-function set_processname(p)
+function mymodule.set_processname(p)
processname = p
confdfile = "/etc/conf.d/"..processname
end
@@ -34,23 +34,23 @@ 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, "Postgresql Status")
end
-function getstatusdetails()
+function mymodule.getstatusdetails()
return cfe({ type="longtext", value="", label="Postgresql Status Details" })
end
-function getfilelist()
+function mymodule.getfilelist()
local listed_files = {}
for i,name in ipairs(determinefilelist()) do
@@ -63,10 +63,12 @@ function getfilelist()
return cfe({ type="list", value=listed_files, label="Postgresql File List" })
end
-function getfiledetails(filename)
+function mymodule.getfiledetails(filename)
return modelfunctions.getfiledetails(filename, determinefilelist())
end
-function updatefiledetails(self, filedetails)
+function mymodule.updatefiledetails(self, filedetails)
return modelfunctions.setfiledetails(self, filedetails, determinefilelist())
end
+
+return mymodule