Skip to content

Commit

Permalink
Merge 19dd1d2 into 6939f86
Browse files Browse the repository at this point in the history
  • Loading branch information
grondo committed May 8, 2018
2 parents 6939f86 + 19dd1d2 commit b4e60b9
Show file tree
Hide file tree
Showing 7 changed files with 261 additions and 172 deletions.
9 changes: 8 additions & 1 deletion src/bindings/lua/wreck.lua
Expand Up @@ -160,14 +160,21 @@ local function get_job_env (arg)
return (env)
end

local function array_tonumber (t)
for i = 1, #t do
t[i] = tonumber (t[i])
end
return t
end


local function job_kvspath (f, id)
assert (id, "Required argument id missing!")
local arg = { id }
if type (id) == "table" then
arg = id
end
local r, err = f:rpc ("job.kvspath", {ids = arg })
local r, err = f:rpc ("job.kvspath", {ids = array_tonumber (arg) })
if not r then error (err) end
if type (id) == "table" then return r.paths end
return r.paths [1]
Expand Down
5 changes: 3 additions & 2 deletions src/bindings/lua/wreck/io.lua
Expand Up @@ -107,9 +107,10 @@ function ioplex.create (arg)
files = {}
}
if not io.kvspath then
local r, err = io.flux:rpc ("job.kvspath", { ids = { io.id }})
local wreck = require 'wreck'
local r, err = wreck.id_to_path { flux = io.flux, jobid = io.id }
if not r then error (err) end
io.kvspath = r.paths [1]
io.kvspath = r
end
setmetatable (io, ioplex)
return io
Expand Down

0 comments on commit b4e60b9

Please sign in to comment.