]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/AuthMonitor: improve error message 22963/head
authorDouglas Fuller <dfuller@redhat.com>
Mon, 20 Nov 2017 18:12:08 +0000 (13:12 -0500)
committerJos Collin <jcollin@redhat.com>
Tue, 10 Jul 2018 11:11:04 +0000 (16:41 +0530)
Improve the error message for 'ceph fs authorize' where the
given entity exists but has different auth caps.

Fixes: http://tracker.ceph.com/issues/21765
Signed-off-by: Douglas Fuller <dfuller@redhat.com>
(cherry picked from commit 447b3d4852acd2db656c973cc224fb77d3fff590)

src/mon/AuthMonitor.cc

index 8698e75a8341c14ab381d7c744ded4355575a664..965958b1220ecc45f6df3dcf62117fe9140ef812 100644 (file)
@@ -1348,8 +1348,8 @@ bool AuthMonitor::prepare_command(MonOpRequestRef op)
       for (const auto &sys_cap : wanted_caps) {
        if (entity_auth.caps.count(sys_cap.first) == 0 ||
            !entity_auth.caps[sys_cap.first].contents_equal(sys_cap.second)) {
-         ss << "key for " << entity << " exists but cap " << sys_cap.first
-            << " does not match";
+         ss << entity << " already has fs capabilities that differ from those supplied. To generate a new auth key for "
+            << entity << ", first remove " << entity << " from configuration files, execute 'ceph auth rm " << entity << "', then execute this command again.";
          err = -EINVAL;
          goto done;
        }