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>
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;
}