From: Tobias Ulmer Date: Fri, 23 May 2014 16:29:55 +0000 (+0200) Subject: transport: add asserts X-Git-Tag: e2factory-2.3.15rc1~200 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=61ea3f95cb396975013ca82071a6439fb902bc9c;p=e2factory.git transport: add asserts Signed-off-by: Tobias Ulmer --- diff --git a/generic/transport.lua b/generic/transport.lua index cf34665..4631ccc 100644 --- a/generic/transport.lua +++ b/generic/transport.lua @@ -274,6 +274,12 @@ end -- @return true on success, false on error -- @return nil, an error string on error function transport.push_file(sourcefile, durl, location, push_permissions, try_hardlink) + assert(type(sourcefile) == "string" and sourcefile ~= "", "sourcefile invalid") + assert(type(durl) == "string" and durl ~= "") + assert(type(location) == "string" and location ~= "") + assert(push_permissions == nil or type(push_permissions) == "string") + assert(try_hardlink == nil or type(try_hardlink) == "boolean") + local rc, e e = err.new("error pushing file to server") durl = string.format("%s/%s", durl, location)