Merge pull request #7301 from oritwas/wip-14375

rgw: fix subuser rm command failure

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
This commit is contained in:
Yehuda Sadeh 2016-01-22 13:33:26 -08:00
commit eea2689b9e

View File

@ -1428,14 +1428,17 @@ int RGWSubUserPool::execute_remove(RGWUserAdminOpState& op_state,
map<std::string, RGWSubUser>::iterator siter;
siter = subuser_map->find(subuser_str);
if (siter == subuser_map->end()){
set_err_msg(err_msg, "subuser not found: " + subuser_str);
return -EINVAL;
}
if (!op_state.has_existing_subuser()) {
set_err_msg(err_msg, "subuser not found: " + subuser_str);
return -EINVAL;
}
// always purge all associate keys
user->keys.remove_subuser_keys(op_state, &subprocess_msg, defer_user_update);
user->keys.remove_subuser_keys(op_state, &subprocess_msg, true);
// remove the subuser from the user info
subuser_map->erase(siter);