From 09265504dcfe45d9683ffa7d3abc1570a55afb2a Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Sun, 20 Oct 2013 00:32:59 +0000 Subject: 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. --- lvm2-model.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lvm2-model.lua') diff --git a/lvm2-model.lua b/lvm2-model.lua index ba63301..1676897 100644 --- a/lvm2-model.lua +++ b/lvm2-model.lua @@ -1,4 +1,4 @@ -module(..., package.seeall) +local mymodule = {} -- Load libraries modelfunctions = require("modelfunctions") @@ -15,19 +15,19 @@ local packagename = "lvm2" -- ################################################################################ -- 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, "LVM Status") end -function getstatusdetails() +function mymodule.getstatusdetails() local status = {} status.pvdisplay = cfe({ type="longtext", label="Physical Volumes" }) status.pvdisplay.value, status.pvdisplay.errtxt = modelfunctions.run_executable({"pvdisplay"}) @@ -37,3 +37,5 @@ function getstatusdetails() return cfe({ type="group", value=status, label="LVM Status Details" }) end + +return mymodule -- cgit v1.2.3