Skip to content

Commit

Permalink
Merge pull request #5214: RGW Swift API: support for 202 Accepted res…
Browse files Browse the repository at this point in the history
…ponse code on container creation

Reviewed-by: Loic Dachary <ldachary@redhat.com>
  • Loading branch information
ldachary committed Jul 19, 2015
2 parents 9e7dded + c78cc00 commit df0b2b8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/rgw/rgw_op.cc
Expand Up @@ -1399,10 +1399,11 @@ void RGWCreateBucket::execute()
/* bucket already existed, might have raced with another bucket creation, or
* might be partial bucket creation that never completed. Read existing bucket
* info, verify that the reported bucket owner is the current user.
* If all is ok then update the user's list of buckets
* If all is ok then update the user's list of buckets.
* Otherwise inform client about a name conflict.
*/
if (info.owner.compare(s->user.user_id) != 0) {
ret = -ERR_BUCKET_EXISTS;
ret = -EEXIST;
return;
}
s->bucket = info.bucket;
Expand All @@ -1414,10 +1415,9 @@ void RGWCreateBucket::execute()
if (ret < 0) {
ldout(s->cct, 0) << "WARNING: failed to unlink bucket: ret=" << ret << dendl;
}
}

if (ret == -EEXIST)
} else if (ret == -EEXIST || (ret == 0 && existed)) {
ret = -ERR_BUCKET_EXISTS;
}
}

int RGWDeleteBucket::verify_permission()
Expand Down

0 comments on commit df0b2b8

Please sign in to comment.