diff options
author | Ted Trask <ttrask01@yahoo.com> | 2015-12-28 16:38:17 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2015-12-28 16:38:17 +0000 |
commit | 2f19efb668330ae932333cdb78bfc18dbb11fe5b (patch) | |
tree | 72379e69a74dcb3bc98833688f3f9f9228c0eb1f /provisioning-model.lua | |
parent | b818b8f33db2547fee487672ac2389c407391da0 (diff) | |
download | acf-provisioning-2f19efb668330ae932333cdb78bfc18dbb11fe5b.tar.bz2 acf-provisioning-2f19efb668330ae932333cdb78bfc18dbb11fe5b.tar.xz |
Better error reporting for editgroup/param when succeeded but setting device params failed
Diffstat (limited to 'provisioning-model.lua')
-rw-r--r-- | provisioning-model.lua | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/provisioning-model.lua b/provisioning-model.lua index 807d08e..fd4c1e4 100644 --- a/provisioning-model.lua +++ b/provisioning-model.lua @@ -1257,11 +1257,16 @@ mymodule.update_group = function(self, group, action, create) -- Update the devices after databasedisconnect so device failure doesn't rollback the change if success then + group.descr = {"Parameter Group Saved"} -- Notify the devices that their params might have changed (this will also validate) for i,d in ipairs(devices) do local r = set_device_params(get_device_params(d.device_id, false), false) - if r.errtxt then self.logevent("ERROR: Failed to update params for device "..d.device_id.."\n"..r:print_errtxt()) end + if r.errtxt then + group.descr[#group.descr+1] = "ERROR: Failed to update params for device "..d.device_id.."\n"..r:print_errtxt() + self.logevent(group.descr[#group.descr]) + end end + group.descr = table.concat(group.descr, "\n") end end) if not res and err then @@ -1442,11 +1447,16 @@ mymodule.update_param = function(self, param, action, create) -- Update the devices after databasedisconnect so device failure doesn't rollback the change if success then + param.descr = {"Parameter Saved"} -- Notify the devices that their params might have changed (this will also validate) for i,d in ipairs(devices) do local r = set_device_params(get_device_params(d.device_id, false), false) - if r.errtxt then self.logevent("ERROR: Failed to update params for device "..d.device_id.."\n"..r:print_errtxt()) end + if r.errtxt then + param.descr[#param.descr+1] = "ERROR: Failed to update params for device "..d.device_id.."\n"..r:print_errtxt() + self.logevent(param.descr[#param.descr]) + end end + param.descr = table.concat(param.descr, "\n") end end) if not res and err then |