From: Yehuda Sadeh Date: Tue, 19 Aug 2014 20:15:46 +0000 (-0700) Subject: rgw: subuser creation fixes X-Git-Tag: v0.86~15^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1441ffe8103f03c6b2f625f37adbb2e1cfec66bb;p=ceph.git rgw: subuser creation fixes Fixes: #8587 There were a couple of issues, one when trying to identify whether swift user exists, we weren't using the correct swift id. The second problem is that we relied on the gen_access flag in the swift case, where it doesn't really need to apply. Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_user.cc b/src/rgw/rgw_user.cc index f21670a115e0..0e7054dfe02f 100644 --- a/src/rgw/rgw_user.cc +++ b/src/rgw/rgw_user.cc @@ -705,15 +705,6 @@ bool RGWAccessKeyPool::check_existing_key(RGWUserAdminOpState& op_state) switch (key_type) { case KEY_TYPE_SWIFT: - kiter = swift_keys->find(kid); - - existing_key = (kiter != swift_keys->end()); - if (existing_key) - break; - - if (swift_kid.empty()) - return false; - kiter = swift_keys->find(swift_kid); existing_key = (kiter != swift_keys->end()); @@ -881,7 +872,7 @@ int RGWAccessKeyPool::generate_key(RGWUserAdminOpState& op_state, std::string *e } while (!rgw_get_user_info_by_access_key(store, id, duplicate_check)); } - if (key_type == KEY_TYPE_SWIFT && gen_access) { + if (key_type == KEY_TYPE_SWIFT) { id = op_state.build_default_swift_kid(); if (id.empty()) { set_err_msg(err_msg, "empty swift access key");