-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rgw: admin rest api shouldn't return error when getting user's stats if the user hasn't create any bucket. #21551
Conversation
the user hasn't create any bucket. Signed-off-by: Zhang Shaowen <zhangshaowen@cmss.chinamobile.com>
src/rgw/rgw_user.cc
Outdated
@@ -2348,7 +2348,7 @@ int RGWUserAdminOp_User::info(RGWRados *store, RGWUserAdminOpState& op_state, | |||
RGWStorageStats *arg_stats = NULL; | |||
if (op_state.fetch_stats) { | |||
int ret = store->get_user_stats(info.user_id, stats); | |||
if (ret < 0) { | |||
if (ret < 0 ret != -ENOENT) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
&&
2d24956
to
e1a1034
Compare
new create user without create any bucket
with get stats
|
tested in http://pulpito.ceph.com/cbodley-2018-04-24_16:16:24-rgw-wip-cbodley-testing-distro-basic-smithi/ and reran in http://pulpito.ceph.com/cbodley-2018-04-24_22:46:52-rgw-wip-cbodley-testing-distro-basic-smithi/ with a fix for valgrind leaks |
If users haven't create any bucket, get_user_stats will return -ENOENT. And the admin rest api will return NoSuchKey which is confusing.
Signed-off-by: Zhang Shaowen zhangshaowen@cmss.chinamobile.com