def get_stored_primary_server_name(db):
 if ('last_primary_server' in db.collection_names()):
  stored_primary_server = db.last_primary_server.find_one()['server']
 else:
  stored_primary_server = None
 return stored_primary_server

def get_stored_primary_server_name ( db ) : if ( 'last_primary_server' in db . collection_names ( ) ) : stored_primary_server = db . last_primary_server . find_one ( ) [ 'server' ] else : stored_primary_server = None return stored_primary_server
get the stored primary server name from db .