Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
ldout(s->cct, 0) << "WARNING: failed to unlink bucket: ret=" << ret << dendl;
}
} else if (ret == -EEXIST || (ret == 0 && existed)) {
- ret = -ERR_BUCKET_EXISTS;
+ ret = 0;
+ exist_ret = -ERR_BUCKET_EXISTS;
}
}
bufferlist in_data;
+ int exist_ret;
+
public:
- RGWCreateBucket() : has_cors(false) {}
+ RGWCreateBucket() : has_cors(false), exist_ret(0) {}
int verify_permission();
void pre_exec();
void RGWCreateBucket_ObjStore_SWIFT::send_response()
{
- if (!ret)
- ret = STATUS_CREATED;
- else if (ret == -ERR_BUCKET_EXISTS)
+ if (exist_ret == -ERR_BUCKET_EXISTS) {
ret = STATUS_ACCEPTED;
+ } else if (!ret) {
+ ret = STATUS_CREATED;
+ }
set_req_state_err(s, ret);
dump_errno(s);
/* Propose ending HTTP header with 0 Content-Length header. */