Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion config/etcd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,17 @@ end
function M:list(keyspath)
local res, response = self:request("GET","keys"..keyspath, { recursive = true, quorum = true })
-- print(yaml.encode(res))
if res.node then
if res.node and res.node.key then
local result = self:recursive_extract(keyspath,res.node)
-- todo: make it with metatable
-- print(yaml.encode(result))
return result, response
-- for _,n in pairs(res.node) do
-- print()
-- end
elseif res.node and (not res.node.key) then
-- Don't use "/" as a etcd prefix in config
error(('Failed to list keys by "%s", node.key is nil'):format(keyspath))
else
error(json.encode(res),2)
end
Expand Down