(
        sds,
        replica_set_name,
        server_description)
return topology_type, replica_set_name
RS without known primary. Update from a non-primary's response.

    Pass in a dict of ServerDescriptions, current replica set name, and the
    ServerDescription we are processing.

    Returns (new topology type, new replica_set_name).
RS without known primary. Update from a non-primary's response.
RS without known primary . Update from a non - primary s response .
def _update_rs_no_primary_from_member(
        sds,
        replica_set_name,
        server_description):
    """RS without known primary. Update from a non-primary's response.

    Pass in a dict of ServerDescriptions, current replica set name, and the
    ServerDescription we are processing.

    Returns (new topology type, new replica_set_name).
    """
    topology_type = TOPOLOGY_TYPE.ReplicaSetNoPrimary
    if replica_set_name is None:
        replica_set_name = server_description.replica_set_name

    elif replica_set_name != server_description.replica_set_name:
        sds.pop(server_description.address)
        return topology_type, replica_set_name

    # This isn't the primary's response, so don't remove any servers
    # it doesn't report. Only add new servers.
    for address in server_description.all_hosts:
        if address not in sds:
            sds[address] = ServerDescription(address)

    if (server_description.me and
            server_description.address != server_description.me):
        sds.pop(server_description.address)

    return topology_type, replica_set_name
def _update_rs_no_primary_from_member ( sds , replica_set_name , server_description ) : topology_type = TOPOLOGY_TYPE . ReplicaSetNoPrimary if replica_set_name is None : replica_set_name = server_description . replica_set_name elif replica_set_name != server_description . replica_set_name : sds . pop ( server_description . address ) return topology_type , replica_set_name # This isn't the primary's response, so don't remove any servers # it doesn't report. Only add new servers. for address in server_description . all_hosts : if address not in sds : sds [ address ] = ServerDescription ( address ) if ( server_description . me and server_description . address != server_description . me ) : sds . pop ( server_description . address ) return topology_type , replica_set_name