summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2013-06-27 13:05:34 +0000
committerTed Trask <ttrask01@yahoo.com>2013-06-27 13:05:34 +0000
commit425a6bba74117818f1bb3578b005acff433df7e9 (patch)
tree4c4c014c2dfb976143b7f34de360927bbaab347c
parent7376bf1a94364a674b3e6f0b2d28e1fa27c9e52b (diff)
downloadacf-provisioning-425a6bba74117818f1bb3578b005acff433df7e9.tar.bz2
acf-provisioning-425a6bba74117818f1bb3578b005acff433df7e9.tar.xz
Fix exception when script has bad syntax
-rw-r--r--provisioning-model.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/provisioning-model.lua b/provisioning-model.lua
index 3efba54..8acc8ca 100644
--- a/provisioning-model.lua
+++ b/provisioning-model.lua
@@ -260,7 +260,7 @@ validateparamcoded = function(p, top)
end
local function callscript(script, ...)
- local result
+ local result={}
local env = {}
setmetatable (env, {__index = _G})
-- loadfile loads into the global environment
@@ -274,6 +274,9 @@ local function callscript(script, ...)
if not res and err then
assert(res, "Exception in "..script.." script\n"..err)
end
+ elseif posix.stat(script) then
+ -- file exists, but wouldn't load
+ error("Failed to load "..script, 0)
end
setfenv (0, _G)
return unpack(result)