From: cao.leilc Date: Tue, 18 Jan 2022 07:03:44 +0000 (+0800) Subject: rgw : add error message when rm key X-Git-Tag: v18.0.0~1476^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=362bc473d1be1a55de782dd315d75a6e685305fb;p=ceph.git rgw : add error message when rm key Fixes: https://tracker.ceph.com/issues/53725 Signed-off-by: caolei --- diff --git a/src/rgw/rgw_user.cc b/src/rgw/rgw_user.cc index e475a16e50d..f3ad401f3fd 100644 --- a/src/rgw/rgw_user.cc +++ b/src/rgw/rgw_user.cc @@ -136,6 +136,18 @@ int rgw_user_get_all_buckets_stats(const DoutPrefixProvider *dpp, return 0; } +static string key_type_to_str(int key_type) { + switch (key_type) { + case KEY_TYPE_SWIFT: + return "swift"; + break; + + default: + return "s3"; + break; + } +} + static bool char_is_unreserved_url(char c) { if (isalnum(c)) @@ -855,7 +867,8 @@ int RGWAccessKeyPool::execute_remove(const DoutPrefixProvider *dpp, map *keys_map; if (!op_state.has_existing_key()) { - set_err_msg(err_msg, "unable to find access key"); + set_err_msg(err_msg, "unable to find access key, with key type: " + + key_type_to_str(key_type)); return -ERR_INVALID_ACCESS_KEY; }