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

Projects
None yet
4 participants
@zhuangzeqiang
Copy link
Contributor

zhuangzeqiang commented Sep 15, 2015

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

This comment has been minimized.

Copy link
Contributor Author

zhuangzeqiang commented Sep 15, 2015

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

This comment has been minimized.

Copy link
Contributor

shinobu-x commented Sep 15, 2015

👍

ceph
rgw: clarify the error message when trying to create an existed user
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 zhuangzeqiang force-pushed the zhuangzeqiang:rgw-cerr branch from 75937e9 to b8c5d5b Sep 17, 2015

@yehudasa

This comment has been minimized.

Copy link
Member

yehudasa commented Sep 17, 2015

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

@zhuangzeqiang

This comment has been minimized.

Copy link
Contributor Author

zhuangzeqiang commented Sep 18, 2015

@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

This comment has been minimized.

Copy link
Member

yehudasa commented Sep 21, 2015

@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

This comment has been minimized.

Copy link
Contributor Author

zhuangzeqiang commented Nov 4, 2015

@yehudasa can it to be merged

yehudasa added a commit that referenced this pull request Nov 6, 2015

Merge pull request #5938 from zhuangzeqiang/rgw-cerr
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 zhuangzeqiang:rgw-cerr branch Nov 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.