summaryrefslogtreecommitdiffstats
path: root/src/auth
diff options
context:
space:
mode:
authorSage Weil <sage@redhat.com>2019-02-05 12:39:01 +0100
committerSage Weil <sage@redhat.com>2019-02-07 19:10:34 +0100
commiteb4af28be4830c4d00c6fe451bf5657554342473 (patch)
treec9c804f3883d003a5eeee122f03165d08ec87d60 /src/auth
parentauth/AuthRegistry: fix locking for get_supported_methods() (diff)
downloadceph-eb4af28be4830c4d00c6fe451bf5657554342473.tar.xz
ceph-eb4af28be4830c4d00c6fe451bf5657554342473.zip
auth/AuthRegistry: only complain about disabling cephx if cephx was enabled
This gets rid of some warnings when auth_supported=none. Signed-off-by: Sage Weil <sage@redhat.com>
Diffstat (limited to 'src/auth')
-rw-r--r--src/auth/AuthRegistry.cc32
1 files changed, 21 insertions, 11 deletions
diff --git a/src/auth/AuthRegistry.cc b/src/auth/AuthRegistry.cc
index b96b0b935a9..a7385a833a8 100644
--- a/src/auth/AuthRegistry.cc
+++ b/src/auth/AuthRegistry.cc
@@ -123,20 +123,30 @@ void AuthRegistry::_refresh_config()
// if we have no keyring, filter out cephx
_no_keyring_disabled_cephx = false;
- KeyRing k;
- int r = k.from_ceph_context(cct);
- if (r == -ENOENT) {
- for (auto *p : {&cluster_methods, &service_methods, &client_methods}) {
- auto q = std::find(p->begin(), p->end(), CEPH_AUTH_CEPHX);
- if (q != p->end()) {
- p->erase(q);
- _no_keyring_disabled_cephx = true;
- }
+ bool any_cephx = false;
+ for (auto *p : {&cluster_methods, &service_methods, &client_methods}) {
+ auto q = std::find(p->begin(), p->end(), CEPH_AUTH_CEPHX);
+ if (q != p->end()) {
+ any_cephx = true;
+ break;
}
}
- if (_no_keyring_disabled_cephx) {
- lderr(cct) << "no keyring found at " << cct->_conf->keyring
+ if (any_cephx) {
+ KeyRing k;
+ int r = k.from_ceph_context(cct);
+ if (r == -ENOENT) {
+ for (auto *p : {&cluster_methods, &service_methods, &client_methods}) {
+ auto q = std::find(p->begin(), p->end(), CEPH_AUTH_CEPHX);
+ if (q != p->end()) {
+ p->erase(q);
+ _no_keyring_disabled_cephx = true;
+ }
+ }
+ }
+ if (_no_keyring_disabled_cephx) {
+ lderr(cct) << "no keyring found at " << cct->_conf->keyring
<< ", disabling cephx" << dendl;
+ }
}
}