From 447b3d4852acd2db656c973cc224fb77d3fff590 Mon Sep 17 00:00:00 2001 From: Douglas Fuller Date: Mon, 20 Nov 2017 13:12:08 -0500 Subject: [PATCH] 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 --- src/mon/AuthMonitor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc index 9c60e37944f..ff78dfb6216 100644 --- a/src/mon/AuthMonitor.cc +++ b/src/mon/AuthMonitor.cc @@ -1325,8 +1325,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; } -- 2.39.5