]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-monstore-tool: print out caps when rebuilding monstore
authorKefu Chai <kchai@redhat.com>
Wed, 3 Apr 2019 09:53:04 +0000 (17:53 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 3 Apr 2019 10:06:11 +0000 (18:06 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/tools/ceph_monstore_tool.cc

index ae3e151b2b427d01ecaa22fbce9117c147ff1a97..cb723c2368e82690c533e61c13ca793fa4c46727 100644 (file)
@@ -473,13 +473,24 @@ static int update_auth(MonitorDBStore& st, const string& keyring_path)
       cerr << "no caps granted to: " << auth_inc.name << std::endl;
       return -EINVAL;
     }
+    map<string,string> caps;
+    std::transform(begin(auth_inc.auth.caps), end(auth_inc.auth.caps),
+                  inserter(caps, end(caps)),
+                  [](auto& cap) {
+                    string c;
+                    auto p = cap.second.cbegin();
+                    decode(c, p);
+                    return make_pair(cap.first, c);
+                  });
+    cout << "adding auth for '"
+        << auth_inc.name << "': " << auth_inc.auth
+        << " with caps(" << caps << ")" << std::endl;
     auth_inc.op = KeyServerData::AUTH_INC_ADD;
 
     AuthMonitor::Incremental inc;
     inc.inc_type = AuthMonitor::AUTH_DATA;
     encode(auth_inc, inc.auth_data);
     inc.auth_type = CEPH_AUTH_CEPHX;
-
     inc.encode(bl, CEPH_FEATURES_ALL);
   }