1
0
mirror of https://github.com/ceph/ceph synced 2025-03-02 22:41:58 +00:00

rgw: don't override error when initializing zonegroup

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
This commit is contained in:
Yehuda Sadeh 2016-03-03 13:04:36 -08:00
parent 0b48c8688b
commit 905b1d9aa9

View File

@ -362,13 +362,16 @@ int rgw_build_bucket_policies(RGWRados* store, struct req_state* s)
s->bucket_owner = s->bucket_acl->get_owner();
RGWZoneGroup zonegroup;
ret = store->get_zonegroup(s->bucket_info.zonegroup, zonegroup);
if (!ret) {
int r = store->get_zonegroup(s->bucket_info.zonegroup, zonegroup);
if (!r) {
if (!zonegroup.endpoints.empty()) {
s->zonegroup_endpoint = zonegroup.endpoints.front();
}
s->zonegroup_name = zonegroup.get_name();
}
if (r < 0 && ret == 0) {
ret = r;
}
if (s->bucket_exists && !store->get_zonegroup().equals(s->bucket_info.zonegroup)) {
ldout(s->cct, 0) << "NOTICE: request for data in a different zonegroup (" << s->bucket_info.zonegroup << " != " << store->get_zonegroup().get_id() << ")" << dendl;