From: Nathan Cutler Date: Sun, 29 Jul 2018 17:32:20 +0000 (+0200) Subject: tools: ceph-authtool: report correct number of caps when creating X-Git-Tag: v14.1.0~1157^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b8c78bd44ea07dbae759a618603ba1a8ebe8025a;p=ceph.git tools: ceph-authtool: report correct number of caps when creating Fixes: https://tracker.ceph.com/issues/23776 Signed-off-by: Nathan Cutler --- diff --git a/src/auth/Auth.h b/src/auth/Auth.h index db1980a3ca6..aac83632bf9 100644 --- a/src/auth/Auth.h +++ b/src/auth/Auth.h @@ -47,7 +47,7 @@ struct EntityAuth { WRITE_CLASS_ENCODER(EntityAuth) static inline ostream& operator<<(ostream& out, const EntityAuth& a) { - return out << "auth(key=" << a.key << " with " << a.caps.size() << " caps)"; + return out << "auth(key=" << a.key << ")"; } struct AuthCapsInfo { diff --git a/src/tools/ceph_authtool.cc b/src/tools/ceph_authtool.cc index c65d58c9b49..f5a78c52726 100644 --- a/src/tools/ceph_authtool.cc +++ b/src/tools/ceph_authtool.cc @@ -173,6 +173,7 @@ int main(int argc, const char **argv) // keyring -------- bool modified = false; + bool added_entity = false; KeyRing keyring; bufferlist bl; @@ -248,7 +249,8 @@ int main(int argc, const char **argv) } keyring.add(ename, eauth); modified = true; - cout << "added entity " << ename << " auth " << eauth << std::endl; + cout << "added entity " << ename << " " << eauth << std::endl; + added_entity = true; } if (!caps_fn.empty()) { ConfFile cf; @@ -276,6 +278,9 @@ int main(int argc, const char **argv) keyring.set_caps(ename, caps); modified = true; } + if (added_entity && caps.size() > 0) { + cout << "added " << caps.size() << " caps to entity " << ename << std::endl; + } // read commands if (list) {