From: Kefu Chai Date: Wed, 3 Apr 2019 09:53:04 +0000 (+0800) Subject: ceph-monstore-tool: print out caps when rebuilding monstore X-Git-Tag: v15.1.0~3008^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2b931aaf3fd140c9c28d637d322324044904ac61;p=ceph.git ceph-monstore-tool: print out caps when rebuilding monstore Signed-off-by: Kefu Chai --- diff --git a/src/tools/ceph_monstore_tool.cc b/src/tools/ceph_monstore_tool.cc index ae3e151b2b4..cb723c2368e 100644 --- a/src/tools/ceph_monstore_tool.cc +++ b/src/tools/ceph_monstore_tool.cc @@ -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 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); }