summaryrefslogtreecommitdiffstats
path: root/config/delete_device.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2013-10-27 01:43:30 +0000
committerTed Trask <ttrask01@yahoo.com>2013-10-27 01:43:30 +0000
commit148d568b3db38ada9cf0c5085d2c71584d588598 (patch)
tree681681965b7089d49121356a367f39f01c661f05 /config/delete_device.lua
parent24e737f23a7ef3a5f5871d75a23470d6ee27462e (diff)
downloadacf-provisioning-148d568b3db38ada9cf0c5085d2c71584d588598.tar.bz2
acf-provisioning-148d568b3db38ada9cf0c5085d2c71584d588598.tar.xz
Revert "Change function prototypes to pass self and use self.model instead of functions table"
This reverts commit fb00ff8f05dae3c110beceb929ea036e4cd14ae1. Conflicts: provisioning-model.lua Conflict was resolved by removing "mymodule." from function calls that are once again made local
Diffstat (limited to 'config/delete_device.lua')
-rw-r--r--config/delete_device.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/config/delete_device.lua b/config/delete_device.lua
index 3b04894..e009e74 100644
--- a/config/delete_device.lua
+++ b/config/delete_device.lua
@@ -1,20 +1,20 @@
-- This is the script run after deleting a device (and all of its params)
-local self, olddevice, oldparams = ...
+local functions, olddevice, oldparams = ...
posix = require("posix")
local root = "/var/www/provisioning/htdocs/"
---self.logevent("got to delete_device script")
+--APP.logevent("got to delete_device script")
-- First, we delete the associated config files for Polycom with valid MAC (not blank or all 0's)
if oldparams.value.device and string.match(oldparams.value.device.label, "Polycom") and oldparams.value.device.value.mac and string.match(oldparams.value.device.value.mac.value, "[1-9A-F]") then
- --self.logevent("Deleting files for "..oldparams.value.device.value.mac.value)
+ --APP.logevent("Deleting files for "..oldparams.value.device.value.mac.value)
local path = root.."Polycom/"
if posix.stat(path, "type") == "directory" then
for d in posix.files(path) do
if string.match(d, string.lower(oldparams.value.device.value.mac.value)) and posix.stat(path..d, "type") == "regular" then
- --self.logevent("deleting "..path..d)
+ --APP.logevent("deleting "..path..d)
os.remove(path..d)
end
end
@@ -56,5 +56,5 @@ setmetatable (env, {__index = _G})
-- so we set env 0, not env 1
setfenv (0, env)
local f = loadfile("/etc/provisioning/update_device_params.lua")
-if (f) then f(self, params, oldparams) end
+if (f) then f(functions, params, oldparams) end
setfenv (0, _G)