Commit 09265504 authored by Ted Trask's avatar Ted Trask
Browse files

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.
parent 4d09a094
module(..., package.seeall)
local mymodule = {}
default_action = "status"
mymodule.default_action = "status"
function status(self)
function mymodule.status(self)
return self.model.getstatus()
end
function startstop(self)
function mymodule.startstop(self)
return self.handle_form(self, self.model.get_startstop, self.model.startstop_service, self.clientdata)
end
function details(self)
function mymodule.details(self)
return self.model.getstatusdetails()
end
return mymodule
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment