From cdc275fc78488777472445d5417dcc9e63b8b6b5 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Sat, 19 Oct 2013 23:58:47 +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. --- qos-controller.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'qos-controller.lua') diff --git a/qos-controller.lua b/qos-controller.lua index f2c45ae..7c5d938 100644 --- a/qos-controller.lua +++ b/qos-controller.lua @@ -1,27 +1,29 @@ -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 startstopinterface(self) +function mymodule.startstopinterface(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.listinterfacedetails(self) end -function enable(self) +function mymodule.enable(self) return self.handle_form(self, self.model.get_enable, self.model.enable, self.clientdata, "Enable", "Enable QOS on Interface", "Enabled QOS on Interface") end -function config(self) +function mymodule.config(self) return self.handle_form(self, self.model.get_config, self.model.update_config, self.clientdata, "Save", "Edit QOS Config", "Configuration Set") end -function expert(self) +function mymodule.expert(self) return self.handle_form(self, self.model.get_filedetails, self.model.update_filedetails, self.clientdata, "Save", "Edit QOS Config", "Configuration Set") end + +return mymodule -- cgit v1.2.3