From 2262acb8dbee2e6005e679d454e5d4358ab443eb Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Mon, 21 Oct 2013 00:02:20 +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. --- ospf-model.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'ospf-model.lua') diff --git a/ospf-model.lua b/ospf-model.lua index 383050b..27d779a 100644 --- a/ospf-model.lua +++ b/ospf-model.lua @@ -1,4 +1,4 @@ -module(..., package.seeall) +local mymodule = {} -- Load libraries modelfunctions = require("modelfunctions") @@ -55,31 +55,31 @@ 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, "OSPF Status") end -function getconfigfile() +function mymodule.getconfigfile() return modelfunctions.getfiledetails(configfile) end -function setconfigfile(self, filedetails) +function mymodule.setconfigfile(self, filedetails) return modelfunctions.setfiledetails(self, filedetails, {configfile}) end -function getdetails() +function mymodule.getdetails() local status = {} status.showip = cfe({ label="OSPF routes" }) status.showip.value = telnetshowip() return cfe({ type="group", value=status, label="OSPF Details" }) end - +return mymodule -- cgit v1.2.3