Browse Source

luci-app-lxc: use ubus binding for lxc-create

Signed-off-by: Petar Koretic <petar.koretic@sartura.hr>
Petar Koretic 10 years ago
parent
commit
d15b15b951
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      utils/luci-app-lxc/files/controller/lxc.lua

+ 2
- 2
utils/luci-app-lxc/files/controller/lxc.lua View File

@@ -80,9 +80,9 @@ function lxc_create(lxc_name, lxc_template)
80 80
 
81 81
 	local target = _G.DISTRIB_TARGET:match('([^/]+)')
82 82
 
83
-	local res = os.execute("lxc-create -t download -n " .. lxc_name .. " -- --server=" .. url .. " --no-validate --dist " .. lxc_template .. " --release bb --arch " .. target)
83
+	local data = conn:call("lxc", "create", { name = lxc_name, template = "download", args = { "--server", url,  "--no-validate", "--dist", lxc_template, "--release", "bb", "--arch", target } } )
84 84
 
85
-	luci.http.write(tostring(res))
85
+	luci.http.write(data)
86 86
 end
87 87
 
88 88
 function lxc_action(lxc_action, lxc_name)