summaryrefslogtreecommitdiffstats
path: root/bgp-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2013-10-21 00:02:20 +0000
committerTed Trask <ttrask01@yahoo.com>2013-10-21 00:02:20 +0000
commit2262acb8dbee2e6005e679d454e5d4358ab443eb (patch)
treead2aa4bf237c205d10e52db75524634c0a804e97 /bgp-model.lua
parent31e61f1805982e6368bc77703e161af674c7687c (diff)
downloadacf-quagga-2262acb8dbee2e6005e679d454e5d4358ab443eb.tar.bz2
acf-quagga-2262acb8dbee2e6005e679d454e5d4358ab443eb.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 'bgp-model.lua')
-rw-r--r--bgp-model.lua15
1 files changed, 8 insertions, 7 deletions
diff --git a/bgp-model.lua b/bgp-model.lua
index 88badc6..c380163 100644
--- a/bgp-model.lua
+++ b/bgp-model.lua
@@ -1,4 +1,4 @@
-module(..., package.seeall)
+local mymodule = {}
-- Load libraries
modelfunctions = require("modelfunctions")
@@ -58,30 +58,31 @@ end
-- ################################################################################
-- PUBLIC FUNCTIONS
-function getstatus()
+function mymodule.getstatus()
return modelfunctions.getstatus(processname, packagename, "BGP 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 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 getdetails()
+function mymodule.getdetails()
local status = {}
status.showipbgp = cfe({ label="BGP routes" })
status.showipbgp.value = telnetshowipbgp()
return cfe({ type="group", value=status, label="BGP Details" })
end
+return mymodule