'We received a MSG_USERAUTH_FAILURE.  Payload::
string methods
byte partial success
If partial success is C{True}, then the previous method succeeded but is
not sufficient for authentication. C{methods} is a comma-separated list
of accepted authentication methods.
We sort the list of methods by their position in C{self.preferredOrder},
removing methods that have already succeeded. We then call
C{self.tryAuth} with the most preferred method.
@param packet: the C{MSG_USERAUTH_FAILURE} payload.
@type packet: L{bytes}
@return: a L{defer.Deferred} that will be callbacked with L{None} as
soon as all authentication methods have been tried, or L{None} if no
more authentication methods are available.
@rtype: C{defer.Deferred} or L{None}'

def ssh_USERAUTH_FAILURE(self, packet):

    (canContinue, partial) = getNS(packet)
    partial = ord(partial)
    if partial:
        self.authenticatedWith.append(self.lastAuth)
    def orderByPreference(meth):
        '\n                                                Invoked    once    per    authentication    method    in    order    to    extract    a\n                                                comparison    key    which    is    then    used    for    sorting.\n\n                                                @param    meth:    the    authentication    method.\n                                                @type    meth:    L{bytes}\n\n                                                @return:    the    comparison    key    for    C{meth}.\n                                                @rtype:    L{int}\n                                                '
        if (meth in self.preferredOrder):
            return self.preferredOrder.index(meth)
        else:
            return len(self.preferredOrder)
    canContinue = sorted([meth for meth in canContinue.split(',') if (meth not in self.authenticatedWith)], key=orderByPreference)
    log.msg(('can    continue    with:    %s' % canContinue))
    return self._cbUserauthFailure(None, iter(canContinue))
