alternator: change empty return of PutItem

Without any arguments, PutItem should return no data at all. But somehow,
for reasons I don't understand, the boto3 driver gets confused from an
empty JSON thinking it isn't JSON at all. If we return a structure with
an empty "attributes" fields, boto3 is happy.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
This commit is contained in:
Nadav Har'El
2019-05-05 20:16:13 +03:00
parent 325773d65b
commit eb13166fb5

View File

@@ -297,7 +297,10 @@ future<json::json_return_type> executor::put_item(sstring content) {
elogger.warn("Applying mutation {}", m);
return _proxy.mutate(std::vector<mutation>{std::move(m)}, db::consistency_level::QUORUM, db::no_timeout, tracing::trace_state_ptr()).then([] () {
return make_ready_future<json::json_return_type>("{}");
// The Boto3 gets confused if we return just an empty structure {},
// thinking it isn't JSON at all. I don't know why, but putting an
// empty Attributes field in the result solves the problem.
return make_ready_future<json::json_return_type>("{ \"Attributes\": {} }");
});
}