#NEWLINE# def _update_rs_with_primary_from_member( sds , replica_set_name , server_description ) : #NEWLINE# #INDENT# 'RS with known primary. Process a response from a non-primary.\n\n    Pass in a dict of ServerDescriptions, current replica set name, and the\n    ServerDescription we are processing.\n\n    Returns new topology type.\n    ' #NEWLINE# assert ( replica_set_name is not None ) #NEWLINE# if ( replica_set_name != server_description . replica_set_name ) : #NEWLINE# #INDENT# sds . pop ( server_description . address ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( server_description . me and ( server_description . address != server_description . me ) ) : #NEWLINE# #INDENT# sds . pop ( server_description . address ) #NEWLINE# #UNINDENT# #UNINDENT# return _check_has_primary ( sds )