]> git.e2factory.org Git - e2factory.git/commitdiff
transport: add asserts
authorTobias Ulmer <tu@emlix.com>
Fri, 23 May 2014 16:29:55 +0000 (18:29 +0200)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:18 +0000 (15:41 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/transport.lua

index cf34665a182a05551d67846709c49bd61d096112..4631ccc7f39e488a804eea4978fa5473081df28a 100644 (file)
@@ -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)