]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw : add error message when rm key 44395/head
authorcao.leilc <cao.leilc@inspur.com>
Tue, 18 Jan 2022 07:03:44 +0000 (15:03 +0800)
committercao.leilc <cao.leilc@inspur.com>
Tue, 18 Jan 2022 07:03:44 +0000 (15:03 +0800)
Fixes: https://tracker.ceph.com/issues/53725
Signed-off-by: caolei <halei15848934852@163.com>
src/rgw/rgw_user.cc

index e475a16e50d7dca7569b5c27f950d36f29372200..f3ad401f3fd719af8f54e6ac61712d433b611bde 100644 (file)
@@ -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<std::string, RGWAccessKey> *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;
   }