Commit 12e12d11 authored by Ted Trask's avatar Ted Trask
Browse files

Replace io.popen with modelfunctions.run_executable

parent 45540de6
......@@ -9,8 +9,6 @@ format = require("acf.format")
local processname = "lvm"
local packagename = "lvm2"
local path = "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin "
-- ################################################################################
-- LOCAL FUNCTIONS
......@@ -32,16 +30,10 @@ end
function getstatusdetails()
local status = {}
status.pvdisplay = cfe({ type="longtext", label="Physical Volumes" })
local cmd = path .. "pvdisplay"
local f = io.popen(cmd)
status.pvdisplay.value = f:read("*a") or ""
f:close()
status.pvdisplay.value, status.pvdisplay.errtxt = modelfunctions.run_executable({"pvdisplay"})
status.lvdisplay = cfe({ type="longtext", label="Logical Volumes" })
cmd = path .. "lvdisplay"
f = io.popen(cmd)
status.lvdisplay.value = f:read("*a") or ""
f:close()
status.lvdisplay.value, status.lvdisplay.errtxt = modelfunctions.run_executable({"lvdisplay"})
return cfe({ type="group", value=status, label="LVM Status Details" })
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment