Skip to content
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: clarify the error message when trying to create an existed user #5938

Merged
merged 1 commit into from Nov 6, 2015

Conversation

zhuangzeqiang
Copy link

Modify the error message when trying to create an existed user to indicate which of uid, email or key actually causes the conflict.

Signed-off-by: Zeqiang Zhuang zhuang.zeqiang@h3c.com

@zhuangzeqiang
Copy link
Author

when creating a user with existing email or key,the error message is "user:xxx exists"

eg.execute " radosgw-admin user create --uid=tid --display-name=tname --email=temail", user tid is successfully created.
execute "radosgw-admin user create --uid=testid --display-name=testname --email=temail",failed with the error message "could not create user: unable to create user, user: tid exists"

We cannot tell which actually causes the conflict (uid, email or key), so I believe it is necessary to print more detailed error messages.

@ghost ghost added cleanup rgw labels Sep 15, 2015
@shinobu-x
Copy link
Contributor

👍

Modify the error message when trying to create an existed user to indicate which of uid, email or key actually causes the conflict.

Signed-off-by: Zeqiang Zhuang <zhuang.zeqiang@h3c.com>
@yehudasa
Copy link
Member

@zhuangzeqiang looking good, I'll need to get it through testing before merging it

@zhuangzeqiang
Copy link
Author

@yehudasa,thx,and I have another question to ask you.
In the following code,can we take uid instead of email ? i think uid is the most important index for user.what do you think ?

/*
if (!op_state.exclusive &&
(user_email.empty() || old_info.user_email == user_email) &&
old_info.display_name == display_name) {
return execute_modify(op_state, err_msg);
}
*/

@yehudasa
Copy link
Member

@zhuangzeqiang I'm not sure about the context of this code, don't we already know that the uid is the same at that point?

@zhuangzeqiang
Copy link
Author

@yehudasa can it to be merged

yehudasa added a commit that referenced this pull request Nov 6, 2015
rgw:  clarify the error message when trying to create an existed user

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
@yehudasa yehudasa merged commit a030e56 into ceph:master Nov 6, 2015
@zhuangzeqiang zhuangzeqiang deleted the rgw-cerr branch November 7, 2015 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants