Hi,
I found two bugs when testing out Lua object class. I am running with Ceph 11.2.0. Can anybody take a look at them?
Zheyuan
Bug 1: I can not get returned output in the first script. "data" is always empty.
import rados, json
cluster = rados.Rados(conffile='')
cluster.connect()
ioctx = cluster.open_ioctx('data')
cmd = {
"script": """
function test(input, output)
data = ""> data:append("test")
objclass.write_full(data, #data)
output:append("Here is the return value")
end
objclass.register(test)
""",
"handler": "test",
"input": "",
}
# I can not get returned data
ret, data = "" 'lua', 'eval_json', json.dumps(cmd))
print ret, data
cmd = {
"script": """
function test(input, output)
output:append("Here is the return value")
end
objclass.register(test)
""",
"handler": "test",
"input": "",
}
# I can get returned data
ret, data = "" 'lua', 'eval_json', json.dumps(cmd))
print ret, data
Bug 2:
The returned mtime is always 0.
cmd = {
"script": """
function test(input, output)
size, mtime = objclass.stat()
output:append(tostring(size))
output:append(tostring(","))
output:append(tostring(mtime))
end
objclass.register(test)
""",
"handler": "test",
"input": "",
}
ret, data = "" 'lua', 'eval_json', json.dumps(cmd))
print ret, data
_______________________________________________ ceph-users mailing list ceph-users@xxxxxxxxxxxxxx http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com