From 362bc473d1be1a55de782dd315d75a6e685305fb Mon Sep 17 00:00:00 2001 From: "cao.leilc" Date: Tue, 18 Jan 2022 15:03:44 +0800 Subject: [PATCH] rgw : add error message when rm key Fixes: https://tracker.ceph.com/issues/53725 Signed-off-by: caolei --- src/rgw/rgw_user.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_user.cc b/src/rgw/rgw_user.cc index e475a16e50d7..f3ad401f3fd7 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; } -- 2.47.3