]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
monclient: fail fast when our auth protocols aren't supported
authorJosh Durgin <josh.durgin@dreamhost.com>
Tue, 1 Nov 2011 17:40:41 +0000 (10:40 -0700)
committerJosh Durgin <josh.durgin@dreamhost.com>
Tue, 1 Nov 2011 18:19:16 +0000 (11:19 -0700)
This handles the case where the server does not support any of the
authentication protocols that the client does. Previously this error
would never be propagated, and you'd only know something went wrong
when the optional timeout expired. Now, monclient->authenticate()
fails as soon as it gets the first response from the monitor.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
src/mon/MonClient.cc

index 112ea63558fa298b3c8874a0ec3884b8090ddbd8..26047491ba8583e55b2c2f9b57d9ae9a9bbefa17 100644 (file)
@@ -440,6 +440,13 @@ void MonClient::handle_auth(MAuthReply *m)
       delete auth;
       auth = get_auth_client_handler(cct, m->protocol, rotating_secrets);
       if (!auth) {
+       ldout(cct, 10) << "no handler for protocol " << m->protocol << dendl;
+       if (m->result == -ENOTSUP) {
+         ldout(cct, 10) << "none of our auth protocols are supported by the server"
+                        << dendl;
+         authenticate_err = m->result;
+         auth_cond.SignalAll();
+       }
        m->put();
        return;
       }