]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
tools: ceph-authtool: report correct number of caps when creating
authorNathan Cutler <ncutler@suse.com>
Sun, 29 Jul 2018 17:32:20 +0000 (19:32 +0200)
committerNathan Cutler <ncutler@suse.com>
Wed, 17 Oct 2018 22:13:14 +0000 (00:13 +0200)
Fixes: https://tracker.ceph.com/issues/23776
Signed-off-by: Nathan Cutler <ncutler@suse.com>
src/auth/Auth.h
src/tools/ceph_authtool.cc

index db1980a3ca683b9cfda2a74faac049517d056eae..aac83632bf977351d91d79361359432ce38ee73d 100644 (file)
@@ -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 {
index c65d58c9b499c37c6c3ac755293ad04698a783ce..f5a78c52726438c5683fd129e2e5b6267ae57289 100644 (file)
@@ -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) {