diff options
author | Ritu Sood <ritu.sood@intel.com> | 2020-03-06 21:52:46 -0800 |
---|---|---|
committer | Ritu Sood <ritu.sood@intel.com> | 2020-03-06 21:52:46 -0800 |
commit | 9ce36aea76d24bb512813d3a1d6444b54819c379 (patch) | |
tree | 5cbf6ec27bf5316c2148bda6f11ea755bfa1ff70 /kud/tests | |
parent | ae7073df0ad8fc2964c25f87ef576ad95a058f6c (diff) |
Remove not required file
commands file is an example and is not needed
Issue-ID: MULTICLOUD-956
Signed-off-by: Ritu Sood <ritu.sood@intel.com>
Change-Id: Ie2097f2491f6dcc2b6347fac120f5e8d47dae120
Diffstat (limited to 'kud/tests')
-rw-r--r-- | kud/tests/sdwan/build/commands.lua | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/kud/tests/sdwan/build/commands.lua b/kud/tests/sdwan/build/commands.lua deleted file mode 100644 index d99f4579..00000000 --- a/kud/tests/sdwan/build/commands.lua +++ /dev/null @@ -1,43 +0,0 @@ --- Licensed to the public under the GNU General Public License v2. - -module("luci.controller.commands", package.seeall) - -sys = require "luci.sys" -ut = require "luci.util" -io = require "io" - -ip = "ip -4 " - -function index() - entry({"admin", "config", "command"}, - call("execute")).dependent = false -end - -function trim(s) - return s:match("^%s*(.-)%s*$") -end - -function split_and_trim(str, sep) - local array = {} - local reg = string.format("([^%s]+)", sep) - for item in string.gmatch(str, reg) do - item_trimed = trim(item) - if string.len(item_trimed) > 0 then - table.insert(array, item_trimed) - end - end - return array -end - -function execute() - local commands = luci.http.formvalue("command") - io.stderr:write("Execute command: %s\n" % commands) - - local command_array = split_and_trim(commands, ";") - for index, command in ipairs(command_array) do - sys.exec(command) - end - - luci.http.prepare_content("application/json") - luci.http.write_json("{'status':'ok'}") -end |