From: Douglas Fuller Date: Mon, 20 Nov 2017 18:12:08 +0000 (-0500) Subject: mon/AuthMonitor: improve error message X-Git-Tag: v12.2.7~10^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F22963%2Fhead;p=ceph.git mon/AuthMonitor: improve error message 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 (cherry picked from commit 447b3d4852acd2db656c973cc224fb77d3fff590) --- diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc index 8698e75a834..965958b1220 100644 --- a/src/mon/AuthMonitor.cc +++ b/src/mon/AuthMonitor.cc @@ -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; }