(sds)
Current topology type is ReplicaSetWithPrimary. Is primary still known?

    Pass in a dict of ServerDescriptions.

    Returns new topology type.
Current topology type is ReplicaSetWithPrimary. Is primary still known?
Current topology type is ReplicaSetWithPrimary . Is primary still known?
def _check_has_primary(sds):
    """Current topology type is ReplicaSetWithPrimary. Is primary still known?

    Pass in a dict of ServerDescriptions.

    Returns new topology type.
    """
    for s in sds.values():
        if s.server_type == SERVER_TYPE.RSPrimary:
            return TOPOLOGY_TYPE.ReplicaSetWithPrimary
    else:
        return TOPOLOGY_TYPE.ReplicaSetNoPrimary
def _check_has_primary ( sds ) : for s in sds . values ( ) : if s . server_type == SERVER_TYPE . RSPrimary : return TOPOLOGY_TYPE . ReplicaSetWithPrimary else : return TOPOLOGY_TYPE . ReplicaSetNoPrimary